New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
helm: Use kubeProxyReplacement as string #26549
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall! Thanks! Two nits regarding an unnecessary toString
Helm coalesce does not consider a boolean variable with "false" value of having a value at all, so $defaultKubeProxyReplacement is picked even if `helm --set kubeProxyReplacement=false` is used with `--set upgradeCompatibility=1.12` (for which the default value is `disabled`). Fix this by explicitly converting .Values.kubeProxyReplacement to a string (also converting "<nil>" to an empty string). Alternatively we could have asked users to use `helm --set-string kubeProxyReplacement=false` instead, but requiring that and silently ignoring `--set kubeProxyReplacement=false` is confusing to users and would be incompatible with possible transition to a boolean kubeProxyReplecement in future. Prior to this PR this helm command gave this output: $ helm template cilium cilium --namespace kube-system --set upgradeCompatibility=1.12 --set kubeProxyReplacement=false | grep kube-proxy-replacement: kube-proxy-replacement: "disabled" After this PR the output is correct: $ helm template cilium cilium --namespace kube-system --set upgradeCompatibility=1.12 --set kubeProxyReplacement=false | grep kube-proxy-replacement: kube-proxy-replacement: "false" Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
538905e
to
ae251d5
Compare
/test |
checkpatch fail is a false positive due to helm command being executed in |
Travis hit #22550, restarting. |
@jrajahalme Does this need the |
Helm coalesce does not consider a boolean variable with
"false"
value of having a value at all, sodisabled
is picked even ifhelm --set kubeProxyReplacement=false
is used with--set upgradeCompatibility=1.12
(for which the default value isdisabled
).Fix this by explicitly converting
.Values.kubeProxyReplacement
to a string, treating<nil>
conversion for a missing value as an empty string.Alternatively we could have asked users to use
helm --set-string kubeProxyReplacement=false
instead, but requiring that and silently ignoring--set kubeProxyReplacement=false
is confusing to users and would be incompatible with possible transition to a booleankubeProxyReplecement
in future.Prior to this PR this helm command gave this output:
After this PR the output is correct:
Fixes: #26496