What happened?
The Helm chart's controller-args template (helm/templates/_controller-args.tpl) emits each controller flag only when its value is truthy:
{{- if .Values.controller.leaderElect }}
- --leader-elect={{ .Values.controller.leaderElect }}
{{- end }}
This conflates "unset" with "explicitly false/0". For flags whose controller default is true (or where 0 is a meaningful value), setting the value to false/0 drops the flag entirely, so the controller silently falls back to its own default.
Concretely, --leader-elect defaults to true in the binary (cmd/agent-sandbox-controller/main.go), so --set controller.leaderElect=false does not disable leader election — the flag is omitted and the controller keeps it enabled. The same footgun affects meaningful zero values, e.g. controller.pprofMutexProfileFraction=0.
How can we reproduce it (as minimally and precisely as possible)?
helm template t ./helm --set image.tag=v0.3.10 --set controller.leaderElect=false \
--show-only templates/deployment.yaml | grep -A3 'args:'
Observed — the --leader-elect flag is absent from the rendered args:
Expected — - --leader-elect=false should be rendered so leader election is actually disabled.
Version
main (chart helm/, Chart.yaml version: 0.1.0)
Anything else we need to know?
Flags whose controller default is false are unaffected (omitting them when false is correct). The fix is to render value-bearing flags based on whether the key is set rather than on truthiness. Happy to send a PR — it can also expose two controller flags the chart does not currently surface (--enable-warm-pool-eviction, default true; --sandbox-warm-pool-max-batch-size, default 300), the first of which needs this fix to be disable-able.
What happened?
The Helm chart's controller-args template (
helm/templates/_controller-args.tpl) emits each controller flag only when its value is truthy:This conflates "unset" with "explicitly
false/0". For flags whose controller default istrue(or where0is a meaningful value), setting the value tofalse/0drops the flag entirely, so the controller silently falls back to its own default.Concretely,
--leader-electdefaults totruein the binary (cmd/agent-sandbox-controller/main.go), so--set controller.leaderElect=falsedoes not disable leader election — the flag is omitted and the controller keeps it enabled. The same footgun affects meaningful zero values, e.g.controller.pprofMutexProfileFraction=0.How can we reproduce it (as minimally and precisely as possible)?
Observed — the
--leader-electflag is absent from the rendered args:Expected —
- --leader-elect=falseshould be rendered so leader election is actually disabled.Version
main (chart
helm/, Chart.yamlversion: 0.1.0)Anything else we need to know?
Flags whose controller default is
falseare unaffected (omitting them when false is correct). The fix is to render value-bearing flags based on whether the key is set rather than on truthiness. Happy to send a PR — it can also expose two controller flags the chart does not currently surface (--enable-warm-pool-eviction, defaulttrue;--sandbox-warm-pool-max-batch-size, default300), the first of which needs this fix to be disable-able.