From 5e3ab70c3f475970dd4e1db37663069156fb0a4e Mon Sep 17 00:00:00 2001 From: Michael Russell Date: Fri, 4 Oct 2019 09:53:55 +0200 Subject: [PATCH] [elasticsearch] Add logging when adding password to keystore This adds the same logging that occurs for all of the other keystore items being added. Useful so that you can be sure that the bootstrap password is properly being added when `ELASTIC_PASSWORD` is set. --- elasticsearch/templates/statefulset.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/elasticsearch/templates/statefulset.yaml b/elasticsearch/templates/statefulset.yaml index 8bf40bcf3..55c85c76e 100644 --- a/elasticsearch/templates/statefulset.yaml +++ b/elasticsearch/templates/statefulset.yaml @@ -161,7 +161,10 @@ spec: done # Add the bootstrap password since otherwise the Elasticsearch entrypoint tries to do this on startup - [ ! -z ${ELASTIC_PASSWORD+x} ] && echo "$ELASTIC_PASSWORD" | elasticsearch-keystore add -x bootstrap.password + if [ ! -z ${ELASTIC_PASSWORD+x} ]; then + echo 'Adding env $ELASTIC_PASSWORD to keystore as key bootstrap.password' + echo "$ELASTIC_PASSWORD" | elasticsearch-keystore add -x bootstrap.password + fi cp -a /usr/share/elasticsearch/config/elasticsearch.keystore /tmp/keystore/ env: {{ toYaml .Values.extraEnvs | nindent 10 }}