Skip to content
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

Merged
merged 1 commit into from Jun 29, 2023

Conversation

jrajahalme
Copy link
Member

@jrajahalme jrajahalme commented Jun 29, 2023

Helm coalesce does not consider a boolean variable with "false" value of having a value at all, so disabled 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, 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 boolean kubeProxyReplecement in future.

Prior to this PR this helm command gave this output:

  $ helm template cilium install/kubernetes/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 install/kubernetes/cilium --namespace kube-system --set upgradeCompatibility=1.12 --set kubeProxyReplacement=false | grep kube-proxy-replacement:
    kube-proxy-replacement: "false"

Fixes: #26496

@jrajahalme jrajahalme added release-blocker/1.14 This issue will prevent the release of the next version of Cilium. affects/v1.14 This issue affects v1.14 branch labels Jun 29, 2023
@jrajahalme jrajahalme requested a review from brb June 29, 2023 06:53
@jrajahalme jrajahalme requested review from a team as code owners June 29, 2023 06:53
@maintainer-s-little-helper maintainer-s-little-helper bot added dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Jun 29, 2023
@jrajahalme jrajahalme added the release-note/misc This PR makes changes that have no direct user impact. label Jun 29, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Jun 29, 2023
Copy link
Member

@brb brb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Member

@gandro gandro left a 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

install/kubernetes/cilium/templates/cilium-configmap.yaml Outdated Show resolved Hide resolved
install/kubernetes/cilium/templates/cilium-configmap.yaml Outdated Show resolved Hide resolved
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>
@jrajahalme
Copy link
Member Author

/test

@jrajahalme
Copy link
Member Author

jrajahalme commented Jun 29, 2023

checkpatch fail is a false positive due to helm command being executed in install/kubernetes so the command line has cilium cilium that checkpatch flags as possible word repetition.

@jrajahalme
Copy link
Member Author

Travis hit #22550, restarting.

@gandro
Copy link
Member

gandro commented Jun 29, 2023

@jrajahalme Does this need the needs-backport/v1.14 label?

@jrajahalme jrajahalme merged commit a1d92d9 into cilium:main Jun 29, 2023
63 of 65 checks passed
@jrajahalme jrajahalme added the needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch label Jun 29, 2023
@joamaki joamaki mentioned this pull request Jul 5, 2023
23 tasks
@joamaki joamaki added backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. and removed needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch labels Jul 5, 2023
@jibi jibi added backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. and removed backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. labels Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects/v1.14 This issue affects v1.14 branch backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. release-blocker/1.14 This issue will prevent the release of the next version of Cilium. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants