Add subPath property for secrets (#1)
* Add subPath property for secrets
This commit is contained in:
@@ -15,4 +15,4 @@ type: library
|
||||
# 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.
|
||||
# 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 }}
|
||||
- name: {{ .name }}
|
||||
mountPath: {{ .path }}
|
||||
{{- if .subPath}}
|
||||
subPath: {{ .subPath }}
|
||||
{{- end }}
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- range .Values.fileSecrets }}
|
||||
- name: {{ .name }}
|
||||
mountPath: {{ .path }}
|
||||
{{- if .subPath}}
|
||||
subPath: {{ .subPath }}
|
||||
{{- end }}
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- range .Values.existingFileSecrets }}
|
||||
|
||||
@@ -19,5 +19,5 @@ version: 0.48.0
|
||||
|
||||
dependencies:
|
||||
- name: common
|
||||
version: 0.2.0
|
||||
version: 0.3.0
|
||||
repository: file://../common
|
||||
|
||||
@@ -19,5 +19,5 @@ version: 0.48.0
|
||||
|
||||
dependencies:
|
||||
- name: common
|
||||
version: 0.2.0
|
||||
version: 0.3.0
|
||||
repository: file://../common
|
||||
|
||||
@@ -18,6 +18,22 @@ tests:
|
||||
- name: google-account-key
|
||||
mountPath: /google-account-key
|
||||
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
|
||||
set:
|
||||
fileSecrets:
|
||||
|
||||
Reference in New Issue
Block a user