Skip to content

Commit

Permalink
[elasticsearch] remove usage of ELASTIC_USERNAME (elastic#1506) (elas…
Browse files Browse the repository at this point in the history
…tic#1508)

This commit remove the usage of ELASTIC_USERNAME and replace it by
hardcoded "elastic" username.

This is required because ELASTIC_USERNAME don't seem to be supported
anymore supported by Elasticsearch (I couldn't find the exact version
where support was stopped).
  • Loading branch information
jmlrt authored Dec 20, 2021
1 parent e35758a commit 28cf0e3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 17 deletions.
4 changes: 2 additions & 2 deletions elasticsearch/examples/config/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ http:
http://localhost:9200/_cluster/health:
status: 200
timeout: 2000
username: "{{ .Env.ELASTIC_USERNAME }}"
username: elastic
password: "{{ .Env.ELASTIC_PASSWORD }}"
body:
- "green"
Expand All @@ -12,7 +12,7 @@ http:
http://localhost:9200:
status: 200
timeout: 2000
username: "{{ .Env.ELASTIC_USERNAME }}"
username: elastic
password: "{{ .Env.ELASTIC_PASSWORD }}"
body:
- '"cluster_name" : "config"'
Expand Down
5 changes: 0 additions & 5 deletions elasticsearch/examples/config/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ extraEnvs:
secretKeyRef:
name: elastic-config-credentials
key: password
- name: ELASTIC_USERNAME
valueFrom:
secretKeyRef:
name: elastic-config-credentials
key: username

# This is just a dummy file to make sure that
# the keystore can be mounted at the same time
Expand Down
6 changes: 3 additions & 3 deletions elasticsearch/examples/security/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ http:
status: 200
timeout: 2000
allow-insecure: true
username: "{{ .Env.ELASTIC_USERNAME }}"
username: elastic
password: "{{ .Env.ELASTIC_PASSWORD }}"
body:
- "green"
Expand All @@ -14,7 +14,7 @@ http:
status: 200
timeout: 2000
allow-insecure: true
username: "{{ .Env.ELASTIC_USERNAME }}"
username: elastic
password: "{{ .Env.ELASTIC_PASSWORD }}"
body:
- '"cluster_name" : "security"'
Expand All @@ -24,7 +24,7 @@ http:
status: 200
timeout: 2000
allow-insecure: true
username: "{{ .Env.ELASTIC_USERNAME }}"
username: elastic
password: "{{ .Env.ELASTIC_PASSWORD }}"
body:
- "active"
Expand Down
5 changes: 0 additions & 5 deletions elasticsearch/examples/security/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ extraEnvs:
secretKeyRef:
name: elastic-credentials
key: password
- name: ELASTIC_USERNAME
valueFrom:
secretKeyRef:
name: elastic-credentials
key: username

secretMounts:
- name: elastic-certificates
Expand Down
4 changes: 2 additions & 2 deletions elasticsearch/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ spec:
set -- "$@" $args
fi
if [ -n "${ELASTIC_USERNAME}" ] && [ -n "${ELASTIC_PASSWORD}" ]; then
set -- "$@" -u "${ELASTIC_USERNAME}:${ELASTIC_PASSWORD}"
if [ -n "${ELASTIC_PASSWORD}" ]; then
set -- "$@" -u "elastic:${ELASTIC_PASSWORD}"
fi
curl --output /dev/null -k "$@" "{{ .Values.protocol }}://127.0.0.1:{{ .Values.httpPort }}${path}"
Expand Down

0 comments on commit 28cf0e3

Please sign in to comment.