Skip to content

fix(chartgen): pull images with policy Always in generated charts - #32

Merged
Sam123ben merged 1 commit into
mainfrom
fix/pull-policy-always
Jul 13, 2026
Merged

Sam123ben merged 1 commit into
mainfrom
fix/pull-policy-always

Conversation

@Sam123ben

Copy link
Copy Markdown
Member

Problem

Generated charts defaulted image.pullPolicy: IfNotPresent while the sandbox registry serves mutable tags (every sandboxctl build re-pushes the same tag). Kubernetes only defaults to Always for the literal :latest, so after a rebuild the rollout restart deploy performs kept running the node's cached image — stale code, no error, nothing to see.

Fix

pullPolicy: Always pinned in every generated values surface:

  • chart values.yaml default (with a comment explaining why)
  • values-sandbox.yaml (per-app)
  • umbrella values-sandbox.yaml nested per-app blocks
  • values-staging.yaml
  • deployment template falls back to Always when values omit the key entirely

Existing repos heal with one re-scaffold: the sandbox/staging/umbrella values are refresh-tracked (v3.1.7), and a flavour-level Always overrides a stale IfNotPresent sitting in an old chart's values.yaml — no need to touch the user's base values.

Verification

  • Regression test pins all four surfaces + the template fallback
  • Fixture with an OLD chart (values.yaml: IfNotPresent, no key in values-sandbox) → re-scaffold → umbrella helm template renders imagePullPolicy: Always on all 3 deployments
  • values-staging.yaml refreshed with Always
  • bash -n, gofmt, go vet, full go test (8 pkgs) green

The sandbox registry serves mutable tags — every 'sandboxctl build'
re-pushes the same tag — but generated values defaulted
image.pullPolicy to IfNotPresent, and Kubernetes only defaults to
Always for the literal :latest tag. Result: after a rebuild, rollout
restarts kept running the node's cached image instead of pulling the
fresh push, silently.

pullPolicy: Always is now pinned in every generated values surface:
the chart's values.yaml default (with the why), values-sandbox.yaml,
the umbrella's nested per-app blocks, and values-staging.yaml. The
deployment template falls back to Always when values omit the key.

Because values-sandbox/umbrella/values-staging are refresh-tracked
files, existing repos heal with one re-scaffold: the sandbox flavour
override beats a stale IfNotPresent left in an old chart's values.yaml
(verified by rendering the umbrella over an old chart — all
deployments come out Always). Regression test pins all surfaces.
@Sam123ben
Sam123ben merged commit 1f75e37 into main Jul 13, 2026
4 of 5 checks passed
@Sam123ben
Sam123ben deleted the fix/pull-policy-always branch July 13, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant