Skip to content

feat(chart): add extraEnv and extraEnvFrom escape hatches - #1

Merged
typedrat merged 1 commit into
mainfrom
typedrat/chart-extra-env
Sep 4, 2026
Merged

feat(chart): add extraEnv and extraEnvFrom escape hatches#1
typedrat merged 1 commit into
mainfrom
typedrat/chart-extra-env

Conversation

@typedrat

@typedrat typedrat commented Sep 4, 2026

Copy link
Copy Markdown
Member

What

Adds extraEnv and extraEnvFrom to the zero-cache chart, scoped per component.

common.extraEnv applies to every component. singleNode, replicationManager
and viewSyncer each take their own, appended after the common entries. Same for
extraEnvFrom.

Why

The chart exposed no way for a consumer to set an environment variable it does not
already model, and consumers rendering through nixidy cannot patch a list-typed
field onto a helm-rendered workload — list overrides are silently dropped while
scalar overrides land. So every unmodelled variable required a chart release.

Documented as an escape hatch, not the preferred way to configure zero-cache:
anything with real semantics should get a typed value so consumers get validation
and defaults.

Semantics

  • Appended after the chart's own env, so repeating a name the chart sets
    overrides it under Kubernetes' last-wins rule. Supported, not merely tolerated.
  • Applies to the zero-cache container only; init containers untouched.
  • Omitted/empty renders byte-identically to 2.1.3 — a safe no-op on upgrade.
  • Entries pass through verbatim as EnvVar / EnvFromSource; not validated by
    the chart. (EnvVar.value must be a string — quote numbers.)

Verification

  • diff against the published 2.1.3 artifact is clean for both single-node and
    multi-node with the values omitted.
  • Two entries append in order with chart env untouched; an override yields both
    entries with the override last; per-component isolation holds.
  • helm lint, kubeconform -strict (incl. a valueFrom secretKeyRef), and
    55 pytest tests pass — 14 new in tests/test_templates.py.

Chart version bumped 2.1.3 -> 2.2.0 (minor; backward-compatible feature).
chart.nix intentionally untouched — the CLI reconciles it against the published
version at publish time.

Consumers had no way to set an environment variable the chart does not
model, and consumers rendering through nixidy cannot patch a list-typed
field onto a helm-rendered workload, so every unmodelled variable
required a chart release.

`common.extraEnv` applies to all components; `singleNode`,
`replicationManager` and `viewSyncer` each take their own, appended
after the common entries. Both land after the chart's own variables, so
repeating a name the chart sets overrides it under Kubernetes'
last-wins rule. They apply to the zero-cache container only, and render
byte-identically to before when empty.
@typedrat
typedrat merged commit b9e55f3 into main Sep 4, 2026
1 check passed
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