-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[elasticsearch] Fix bug in keystore initContainer #301
[elasticsearch] Fix bug in keystore initContainer #301
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
fyi, I just signed the CLA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you for finding and fixing this.
jenkins test this please |
@Crazybus Is the fixed available in a feature branch? I can give it a quick test run? |
It has been merged into master. So you can try it out there. If you wait a day or two there should be a new release (no promises though). |
@Crazybus @ravishivt Giving the elastic pod is not accessible due to the privileged setting. How do I verify the slack url is set by the keystore? The elasticsearch deployment is 7.4.0. This is from Kibana log when I try to create a watcher. The error shows the 'devopswatcher' is a invalid slack.
Secrets:
|
The account names don't match up. You added a
Please open an issue if you are still having problems. Comments on closed PRs might be missed. |
@Crazybus Oops on my part. Thanks for pointing out the incorrect setting. |
${CHART}/tests/*.py
${CHART}/examples/*/test/goss.yaml
This fixes a bug in the
keystore
initContainer as reported in #280. The root cause was usingset -u
and the variable unset check[ ! -z "$ELASTIC_PASSWORD" ]
. Doing the variable check this way violatesset -u
since it is considered to be accessing the variable. The fix is to change the unset check to[ ! -z ${ELASTIC_PASSWORD+x} ]
as per https://stackoverflow.com/a/13864829/684893.Note the error that the
keystore
initContainer reports without the fix:k8s-prod$ kubectl logs test-elasticsearch-master-0 -c keystore Created elasticsearch keystore in /usr/share/elasticsearch/config Adding file /tmp/keystoreSecrets/aws-credentials/s3.client.default.access_key to keystore key s3.client.default.access_key Adding file /tmp/keystoreSecrets/aws-credentials/s3.client.default.secret_key to keystore key s3.client.default.secret_key sh: line 12: ELASTIC_PASSWORD: unbound variable
You can verify the issue and the fix using these simple tests: