Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Elasticsearch secret mountmode #596

Merged
merged 2 commits into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions elasticsearch/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ spec:
- name: {{ .name }}
secret:
secretName: {{ .secretName }}
{{- if .defaultMode }}
defaultMode: {{ .defaultMode }}
{{- end }}
{{- end }}
{{- if .Values.esConfig }}
- name: esconfig
Expand Down
18 changes: 18 additions & 0 deletions elasticsearch/tests/elasticsearch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,24 @@ def test_adding_a_secret_mount_with_subpath():
}


def test_adding_a_secret_mount_with_default_mode():
config = """
secretMounts:
- name: elastic-certificates
secretName: elastic-certs
path: /usr/share/elasticsearch/config/certs
subPath: cert.crt
defaultMode: 0755
"""
r = helm_template(config)
s = r["statefulset"][uname]["spec"]["template"]["spec"]
assert s["containers"][0]["volumeMounts"][-1] == {
"mountPath": "/usr/share/elasticsearch/config/certs",
"subPath": "cert.crt",
"name": "elastic-certificates",
}


def test_adding_image_pull_secrets():
config = """
imagePullSecrets:
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ secretMounts: []
# - name: elastic-certificates
# secretName: elastic-certificates
# path: /usr/share/elasticsearch/config/certs
# defaultMode: 0755

image: "docker.elastic.co/elasticsearch/elasticsearch"
imageTag: "7.6.2"
Expand Down