Output of helm version: version.BuildInfo{Version:"v3.7.1+7.el8", GitCommit:"8f33223fe17957f11ba7a88b016bc860f034c4e6", GitTreeState:"clean", GoVersion:"go1.16.7"}
Output of kubectl version: Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.4",
Cloud Provider/Platform (AKS, GKE, Minikube etc.): ocp
values.yaml:
in template:
{{ default true .Values.exampleKey }}
I would expect this template to write false because false as a string is false and exampleKey is not omitted with its false value. However that block outputs true.
I read the manual that states:
This function allows you to specify a default value inside of the template, in case the value is omitted

In this case, the value is clearly not omitted and it's explicitly false. However, it's expected in case it's omitted, it becomes true (omitted, would mean the nil value, which is the value in go template when the value is non-existing in the dict).
Output of
helm version:version.BuildInfo{Version:"v3.7.1+7.el8", GitCommit:"8f33223fe17957f11ba7a88b016bc860f034c4e6", GitTreeState:"clean", GoVersion:"go1.16.7"}Output of
kubectl version:Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.4",Cloud Provider/Platform (AKS, GKE, Minikube etc.): ocp
values.yaml:
in template:
I would expect this template to write
falsebecausefalseas a string isfalseandexampleKeyis not omitted with itsfalsevalue. However that block outputstrue.I read the manual that states:
In this case, the value is clearly not omitted and it's explicitly
false. However, it's expected in case it's omitted, it becomestrue(omitted, would mean thenilvalue, which is the value in go template when the value is non-existing in the dict).