Technical questionAccepted answer
If clause in helm chart
Riccardo Califano
Jul 10
0 views1
How can I check if a variable is a boolean value "true" in helm chart? I have in Values.yaml a parameter set as:
myParameter: true
I don't understand well difference between:
{{- if .Values.service.myParameter }}
and
{{- if eq .Values.service.myParameter "true" }}
I want that flow goes in if clause if the parameter is set as boolean "true"
1 answer
Accepted answer · original discussion
codeaprendiz
PermalinkJul 10
You can use the following snipped for checking the boolean value
{{if (default .Values.seLinux true)}}
securityContext:
seLinuxOptions:
user: system_u
{{ end }}
Then the Values file will have following snippet
seLinux: true
Please let me know if this helps.
0 question comments
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.