Add subPath property for secrets (#1)

* Add subPath property for secrets
This commit is contained in:
pnieweglowski
2023-06-02 21:44:09 +02:00
committed by GitHub
parent ffeba134d6
commit 2bbbb208f4
5 changed files with 25 additions and 3 deletions
+1 -1
View File
@@ -15,4 +15,4 @@ type: library
# This is the chart version. This version number should be incremented each time you make changes # This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version. # to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/) # Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.0 version: 0.3.0
@@ -13,11 +13,17 @@ volumeMounts: &volumeMounts
{{- range .Values.sealedFileSecrets }} {{- range .Values.sealedFileSecrets }}
- name: {{ .name }} - name: {{ .name }}
mountPath: {{ .path }} mountPath: {{ .path }}
{{- if .subPath}}
subPath: {{ .subPath }}
{{- end }}
readOnly: true readOnly: true
{{- end }} {{- end }}
{{- range .Values.fileSecrets }} {{- range .Values.fileSecrets }}
- name: {{ .name }} - name: {{ .name }}
mountPath: {{ .path }} mountPath: {{ .path }}
{{- if .subPath}}
subPath: {{ .subPath }}
{{- end }}
readOnly: true readOnly: true
{{- end }} {{- end }}
{{- range .Values.existingFileSecrets }} {{- range .Values.existingFileSecrets }}
+1 -1
View File
@@ -19,5 +19,5 @@ version: 0.48.0
dependencies: dependencies:
- name: common - name: common
version: 0.2.0 version: 0.3.0
repository: file://../common repository: file://../common
+1 -1
View File
@@ -19,5 +19,5 @@ version: 0.48.0
dependencies: dependencies:
- name: common - name: common
version: 0.2.0 version: 0.3.0
repository: file://../common repository: file://../common
@@ -18,6 +18,22 @@ tests:
- name: google-account-key - name: google-account-key
mountPath: /google-account-key mountPath: /google-account-key
readOnly: true readOnly: true
- it: Should mount volume with optional subPath
set:
fileSecrets:
- name: google-account-key
path: /config/google-account-key
subPath: google-account-key
secrets:
key.json: supersecret
asserts:
- equal:
path: spec.template.spec.containers[0].volumeMounts
value:
- name: google-account-key
mountPath: /config/google-account-key
subPath: google-account-key
readOnly: true
- it: Should reference volume - it: Should reference volume
set: set:
fileSecrets: fileSecrets: