File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
null_checking_bug/templates Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 11{ {- define " null_checking_bug.isPasswordExplicit" -} }
2- { {- typeIs " string" .Values.existingSecret -} }
2+ { {- if typeIs " string" .Values.existingSecret -} }
3+ true
4+ { {- else -} }
5+ false
6+ { {- end -} }
37{ {- end -} }
48
59{ {- define " null_checking_bug.isSecretName" -} }
6- { {- and (typeIs " map[string]interface {}" .Values.existingSecret)
10+ { {- if and (typeIs " map[string]interface {}" .Values.existingSecret)
711 (get .Values.existingSecret " name" ) -} }
12+ true
13+ { {- else -} }
14+ false
15+ { {- end -} }
816{ {- end -} }
917
1018
1119{ {- define " null_checking_bug.evaluateNameOfSecret" -} }
12- { {- if (include " null_checking_bug.isPasswordExplicit" .) -} }
20+ { {- if eq " true " (include " null_checking_bug.isPasswordExplicit" .) -} }
1321 "default-secret"
14- { {- else if (include " null_checking_bug.isSecretName" .) -} }
15- { {- .Values.existingSecret.name | default " default-secret" } }
22+ { {- else if eq " true " (include " null_checking_bug.isSecretName" .) -} }
23+ { {- .Values.existingSecret.name | default " replace- default-secret" | quote } }
1624 { {- end } }
1725{ {- end -} }
Original file line number Diff line number Diff line change 33 isSecretName : {{ (include "null_checking_bug.isSecretName" .) | quote }}
44 isPasswordExplicit : {{ (include "null_checking_bug.isPasswordExplicit" .) | quote }}
55 nameOfSecret : {{ include "null_checking_bug.evaluateNameOfSecret" . }}
6- {{- if (include "null_checking_bug.isSecretName" .) -}}
7- nameOfSecretFromValuesYaml : {{ .Values.existingSecret.name }}
8- {{- end }}
96 typeOfSecretName : {{ typeOf (include "null_checking_bug.isSecretName" .) | quote }}
107kind : Secret
118metadata :
You can’t perform that action at this time.
0 commit comments