Flattening secret.enabled to secretEnabled to follow Helm best practices; Also supporting custom names
This commit is contained in:
@@ -43,9 +43,9 @@ spec:
|
|||||||
- configMapRef:
|
- configMapRef:
|
||||||
name: {{ template "robustName" .Release.Name }}
|
name: {{ template "robustName" .Release.Name }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.secret.enabled }}
|
{{- if .Values.secretEnabled }}
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: {{ template "robustName" .Release.Name }}
|
name: {{ .Values.secretName | default (include "robustName" $.Release.Name) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.sealedSecrets }}
|
{{- if .Values.sealedSecrets }}
|
||||||
- secretRef:
|
- secretRef:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ templates:
|
|||||||
tests:
|
tests:
|
||||||
- it: Should reference secret if secret is enabled
|
- it: Should reference secret if secret is enabled
|
||||||
set:
|
set:
|
||||||
secret.enabled: true
|
secretEnabled: true
|
||||||
asserts:
|
asserts:
|
||||||
- contains:
|
- contains:
|
||||||
path: spec.template.spec.containers[0].envFrom
|
path: spec.template.spec.containers[0].envFrom
|
||||||
@@ -14,10 +14,20 @@ tests:
|
|||||||
name: release-name
|
name: release-name
|
||||||
- it: Should not reference secret if secret is disabled
|
- it: Should not reference secret if secret is disabled
|
||||||
set:
|
set:
|
||||||
secret.enabled: false
|
secretEnabled: false
|
||||||
asserts:
|
asserts:
|
||||||
- isNull:
|
- isNull:
|
||||||
path: spec.template.spec.containers[0].envFrom
|
path: spec.template.spec.containers[0].envFrom
|
||||||
|
- it: Should not reference secret if secret is disabled
|
||||||
|
set:
|
||||||
|
secretEnabled: true
|
||||||
|
secretName: my-custom-secret
|
||||||
|
asserts:
|
||||||
|
- contains:
|
||||||
|
path: spec.template.spec.containers[0].envFrom
|
||||||
|
content:
|
||||||
|
secretRef:
|
||||||
|
name: my-custom-secret
|
||||||
- it: Should reference secret if sealedSecrets is set
|
- it: Should reference secret if sealedSecrets is set
|
||||||
set:
|
set:
|
||||||
sealedSecrets:
|
sealedSecrets:
|
||||||
|
|||||||
@@ -40,8 +40,7 @@ probe:
|
|||||||
timeoutSeconds: 3
|
timeoutSeconds: 3
|
||||||
failureThreshold: 3
|
failureThreshold: 3
|
||||||
|
|
||||||
secret:
|
secretEnabled: false
|
||||||
enabled: false
|
|
||||||
|
|
||||||
shell: "/bin/sh"
|
shell: "/bin/sh"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user