I am trying to declare that a block of code in a helm template should be present if a variable is true OR does not exist (ie, the default of the var is true). The following works:
{{- if or .Values.livenessProbe (not (hasKey .Values "livenessProbe")) }}
...
{{- end }}
This seems rather complex, is there something simpler? I tried with default
function in a few ways but they all result in ignoring the value (present or not, true or false, the block always gets rendered):
{{- if (default true .Values.livenessProbe) }}
...
{{- end }}