Skip to content

fix(chart, e2e): the edge's MeshConfig is in every revision's manifest, so helm rollback works to the revision that created the edge namespace (#1514, #1515, #1543) - #1567

Merged
bpalermo merged 7 commits into
mainfrom
fix/meshconfig-seed-rollback-1514
Oct 9, 2026

Conversation

@bpalermo

@bpalermo bpalermo commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Closes #1515

Part of #1514 (the edge, which is the title and the default; the control-plane case is left, see "Not fixed") and of #1543 (the script runs under Helm 4; the nightly job is not changed). #1542 is not touched; what was measured for it is at the end.

An agent wrote this pull request. Base: da5198b2 (main merged in since, no conflict).

What was reproduced

All on kind (Kubernetes v1.35.8), the real chart and images, before any change. Follow-ups to #1513.

Issue Helm 3.18.4 Helm 4.2.0 (server-side apply)
#1514: edge.enabled=true at defaults, an upgrade, helm rollback aether 1 fails: Error: no MeshConfig with the name "default" found; release failed at revision 3; revision 1's manifest holds 1 MeshConfig, revision 2's none rolls back (resource exists on cluster but not in original release, using cluster state as baseline)
#1515: a release that owns its namespace, the ownership annotations removed, an upgrade (the Namespace leaves the manifest, kept), helm rollback to the revision that holds it fails: Error: no Namespace with the name "aether-system" found; release failed; namespace untouched (same UID, Active) rolls back

So #1515's "probably" is confirmed, for Helm 3. Both are the same Helm 3 behaviour as #1471 (pkg/kube/client.go, Update), and Helm 4.2.0 has neither.

#1514: the edge's MeshConfig

A pre-install hook runs before the release's objects exist, so it cannot create the edge's MeshConfig in a namespace the same revision creates. It therefore stayed an object of the release, seeded once: in that one manifest, in no later one, still live.

The fix is the opposite of a hook: render it on every revision, for a release whose edge namespace this chart created. That is safe for this MeshConfig because the chart sets no field of its spec (spec: {} whatever the values):

  • Helm 3 patches a custom resource with the difference between the previous manifest and the new one. That is empty for the spec on every upgrade and rollback.
  • Helm 4 applies an empty spec, which owns no field.

Which releases: the Namespace carries aether.io/edge-meshconfig-in-manifest: "true" from the revision that creates it, and the chart reads that back with lookup (aether.edge.meshConfigInManifest). A namespace created by 2.4.24 or older is never marked. Bringing a live MeshConfig back into the manifest would make that revision one that cannot be rolled back to from an older one: the same bug, one revision later.

Routes not taken: the Namespace as a hook (its lifetime would then hang on hook semantics, including the undocumented never, and an upgrade from 2.4.24 would drop it from the manifest); a post-install hook (deadlocks --wait, as #1513 found).

Render, before and after (helm template, chart version held equal)

Values Difference
default byte-identical
edge.enabled=true the edge Namespace gains the annotation below, and the edge's MeshConfig (a release object with helm.sh/resource-policy: keep) gains the same annotation line; nothing else
edge.enabled=true, edge.namespaceCreate=false byte-identical (both MeshConfigs are hooks)
edge.enabled=true, meshConfig.createDefault=false byte-identical (no marker, no MeshConfig)
 kind: Namespace
 metadata:
   name: aether-ingress
+  annotations:
+    aether.io/edge-meshconfig-in-manifest: "true"
   labels:

The change that matters is on later revisions and needs a cluster: with the marker on the live namespace the MeshConfig is rendered again instead of skipped. No pod template changes.

Review round 1: back through chart 2.4.24 (the one-release skew)

Copilot's finding, reproduced on kind with Helm 3.18.4 and the published 2.4.24 chart: 2.4.24 renders the edge Namespace without the marker, so an upgrade to it (or a rollback to one of its revisions) takes the marker off, and it leaves the live MeshConfig out of the manifest. With the Namespace as the only place the marker lived, the next 2.4.25 revision left the MeshConfig out too, for good, and helm rollback to the original 2.4.25 revisions failed with no MeshConfig with the name "default" found.

Fixed as suggested: the MeshConfig carries the marker as well, and either one is enough. 2.4.24 does not render the live MeshConfig, so it does not touch its annotations; the next upgrade to this chart renders the MeshConfig again and marks the Namespace again. The Namespace's marker stays as the second source: a MeshConfig deleted or replaced by hand carries none, and an object that was in the previous manifest and is not rendered is deleted by Helm. Objects of an older chart carry neither and are still not re-adopted.

Measured after the fix (Helm 3.18.4): revisions 1, 2 (this chart), 3 (2.4.24), 4 (this chart) hold 1, 1, 0, 1 MeshConfig; rollback to 1, to 4, to 3, an upgrade, and a rollback to 2 all succeed; the namespace is marked again after each upgrade to this chart.

What cannot be closed, and the runbook says so: under Helm 3 a helm rollback straight from a 2.4.24 revision to a 2.4.25 one fails (measured), because the stored 2.4.24 manifest holds no MeshConfig. helm upgrade goes forward.

e2e leg viii-b does 2.4.25 -> 2.4.24 -> 2.4.25 with the published chart, pulled by its commit tag (the bare 2.4.24 tag was rewritten while this was being written, and a tag@digest reference then failed on a digest mismatch). Against the previous head of this branch:

  ✗ after an upgrade through chart 2.4.24 the chart no longer renders the edge's MeshConfig (revision 22 holds 0): no later revision can be rolled back from to revision 17

and on this head, under Helm 3.18.4 and Helm 4.2.0 (whole suite green on both):

  ✓ through chart 2.4.24 (revision 21, no MeshConfig, no marker) and back (revision 22): the MeshConfig is rendered and the namespace marked again; rollback to revision 17 and to 22 works; same object, edit kept

The template test aether_edge_meshconfig_seed_created_namespace_test now expects the annotation on the MeshConfig; it failed against the previous head.

What an operator sees on upgrade

No workload rolls and no MeshConfig changes. Helm does patch the helm.sh/chart label on the objects it renders, as on every chart upgrade (review round 2). Measured with Helm 3.18.4: a release installed and upgraded by the chart on main with the edge on, an edit of the edge's MeshConfig, then an upgrade to this chart.

  • The seven workloads keep generation=1; both MeshConfigs keep UID, generation and spec; the edge namespace's annotations are unchanged (no marker).
  • The stored manifests of the two revisions differ only in the chart-version labels.
  • helm rollback to the 2.4.24 revision and back to the 2.4.25 one both succeed. Rollback to the old seeding revision still fails as before (documented; the way round of "Chart 2.4.24" applies). An upgrade back to the 2.4.24 chart succeeds.

For an edge namespace created by 2.4.25:

  • helm rollback works to the revision that created it. helm get manifest lists the edge's MeshConfig on every revision.
  • An edit of that MeshConfig survives an upgrade and a rollback in each direction (same UID, field kept): Helm 3.18.4 and Helm 4.2.0, e2e leg viii.
  • Also measured (Helm 3.18.4): meshConfig.createDefault=false takes the MeshConfig out of the manifest and leaves it live with its spec, and turning it on again brings the same object back; an object deleted and recreated by hand stays as created through an upgrade and two rollbacks (it gains Helm's ownership annotations); a deleted one is created again by the next upgrade.
  • helm uninstall and edge.enabled=false delete the edge namespace as before.

Post-deploy check (runbook, "Chart 2.4.25"):

kubectl -n aether-ingress get meshconfig default -o jsonpath='{.metadata.uid} generation={.metadata.generation}{"\n"}'
kubectl -n aether-ingress get deploy aether-edge -o custom-columns=NAME:.metadata.name,GENERATION:.metadata.generation
kubectl get namespace aether-ingress -o jsonpath='{.metadata.annotations.aether\.io/edge-meshconfig-in-manifest}{"\n"}'

#1515: a runbook note, no chart change

A chart cannot change a stored manifest, and Helm refuses a Namespace the release does not own if the chart renders it again. The runbook ("Chart 2.4.25") has the error, the check for affected revisions, and the way round, measured: helm upgrade with that revision's values (helm get values --revision N -o yaml, passed with -f) succeeds, also after the failed rollback.

#1543: the script under Helm 4

release_field reads helm status -o json instead of helm list -a; the diagnostics pick the list flags by version; verify prints the Helm version. That was the only incompatibility: the whole suite passes under Helm 4.2.0 (release apply_method: ssa), leg v-a2 on its "the upgrade went through" branch.

Not done: running the nightly job on each Helm. That is a workflow change and is left for a separate pull request.

Tests, red first

Template tests (charts/aether/BUILD.bazel), against the unchanged chart:

Test On main Here
aether_edge_namespace_marks_meshconfig_in_manifest_test FAILED passes
aether_edge_namespace_unmarked_without_seed_test (guard: no marker with meshConfig.createDefault=false) passes passes
aether_edge_namespace_still_rendered_test (existing guard, now also pins the one annotation) n/a passes
aether_edge_meshconfig_seed_created_namespace_test (existing: a release object, no hook annotation) passes passes

Mutation: with the annotation misspelt in the template, the first and third fail. lookup returns nothing under helm template, so the later-revision behaviour is tested on a cluster only.

e2e: e2e/first-install.sh gets leg viii, run last. It turns the edge on with its defaults, waits for the edge pods, edits the MeshConfig, upgrades, rolls back to the revision that created the namespace and forward, and asserts the release is deployed, the MeshConfig is the same object with the edit, both manifests hold it and the namespace is marked; then turns the edge off. up now installs the Gateway API CRDs (the edge renders a Gateway).

This branch's script against the charts on main, Helm 3.18.4:

==> viii. the edge's MeshConfig, in a namespace the same revision creates (#1514)
  ✓ the edge is on at revision 17: the chart created aether-ingress and the MeshConfig in it (uid f5aa067c-…), and the edge pods are Ready
  ✗ helm rollback aether 17 (the revision that created aether-ingress and its MeshConfig) failed: Error: no MeshConfig with the name "default" found

Against this branch, the whole suite passes with Helm 3.18.4 and with Helm 4.2.0:

==> viii. the edge's MeshConfig, in a namespace the same revision creates (#1514)
  ✓ the edge is on at revision 17: the chart created aether-ingress and the MeshConfig in it (uid a70d2bf4-…), and the edge pods are Ready
  ✓ rolled back to revision 17 and forward to revision 18; the release is deployed
  ✓ the edge's MeshConfig is the same object (uid a70d2bf4-…) and kept the operator's edit
  ✓ revisions 17 and 18 both hold the edge's MeshConfig; aether-ingress carries aether.io/edge-meshconfig-in-manifest
  ✓ the edge is off again and aether-ingress is gone

bazel test //charts/... //e2e/...: 251 pass. The lint build over //charts/... //e2e/..., make format-check and scripts/check-shell-lint.sh pass.

Not fixed, and not verified

  • The control plane's MeshConfig with namespace.create=true (the release stored in another namespace) is still seeded once as a release object, and under Helm 3 that revision still cannot be rolled back to. The same fix does not carry over: that seed holds meshConfig.proxy, and a spec rendered again is patched over the operator's (Helm 3) or conflicts with it (Helm 4). Not reproduced here; it is the same code path as the edge case was. chart: helm rollback still fails for the revision that seeds a MeshConfig in a namespace the same revision creates (the edge, by default) #1514 could be narrowed to it.
  • chart: under Helm 4 server-side apply the MeshConfig seed hook is not create-only #1542 (the seed hook is not create-only under Helm 4's server-side apply): nothing changed. Two things were measured against the API server with kubectl, not through Helm:
    • A fixed metadata.uid in the seed does not work. An apply over an existing object is refused (metadata.uid: field is immutable), but an apply that creates is refused too (uid mismatch ... no existing object was found), so a Helm 4 install would fail.
    • A ValidatingAdmissionPolicy on UPDATE of meshconfigs that denies a request adding helm.sh/hook to an object that did not carry it does what is wanted: the apply of the seed over an operator's object is denied and the object is untouched, an apply that creates goes through, and ordinary edits are unaffected. It would add two cluster-scoped admission objects to every install, so it is left as a decision.
  • The Helm 4 binary was the upstream release tarball, checked against the .sha256sum published next to it. No other Helm 4 version was tried.
  • Leg viii-b pulls the published 2.4.24 chart from the registry, a new network dependency of the suite (it fails, and does not skip, when the pull fails).
  • A rollback straight from a 2.4.24 revision to a 2.4.25 one was measured with Helm 3 only; the Helm 4 attempt ran into the release's history limit and says nothing.
  • The nightly first-install job has not run with leg viii; the suite was run locally. The last nightly took 7 minutes of its 45; the full suite took about 13 minutes locally.
  • How a tool that renders with helm template and applies the result behaves is unchanged and was not tried: it renders the marked form on every sync, a MeshConfig with an empty spec, as before.

Chart version

aether 2.4.24 -> 2.4.25 (main is at 2.4.24).

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

bpalermo and others added 2 commits October 9, 2026 15:46
…t, so helm rollback works to the revision that created the edge namespace (#1514, #1515, #1543)

A pre-install hook cannot seed the edge's MeshConfig in a namespace the same
revision creates (edge.namespaceCreate=true, the default once the edge is on),
so there it stayed an object of the release, seeded once: in that revision's
manifest, in no later one, and still live. Under Helm 3, helm rollback to that
revision failed with 'no MeshConfig with the name "default" found' (#1471's
failure, measured on kind with Helm 3.18.4; Helm 4.2.0 rolls back).

The chart now renders that MeshConfig on every revision of a release whose
edge namespace it created; the namespace carries
aether.io/edge-meshconfig-in-manifest. The chart sets no field of its spec, so
rendering it again never touches the operator's. A namespace an older chart
created is not marked and is treated as before: upgrading changes nothing.

#1515 reproduces (Helm 3: 'no Namespace with the name "aether-system" found',
Helm 4 rolls back). No chart can change a stored manifest; the runbook has the
check and the way round.

e2e/first-install.sh runs under Helm 3 and Helm 4 (helm status in place of
helm list -a) and gains leg viii, which needs the Gateway API CRDs.

Chart aether 2.4.24 -> 2.4.25.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The stateful rendering behavior is documented and covered by template and cross-version rollback tests.

0 open findings

What changed in this PR

Ensures edge MeshConfig resources remain in every applicable Helm revision, enabling reliable Helm 3 rollbacks while preserving operator edits.

Changes:

  • Marks chart-created edge namespaces and persistently renders their empty MeshConfig.
  • Adds Helm 3/4-compatible rollback E2E coverage and Gateway API setup.
  • Updates chart version, tests, and operator documentation.
File Description
e2e/​first-install.sh Tests edge rollback behavior across Helm versions.
docs/​runbook.md Documents rollback behavior and recovery procedures.
docs/​proposals/​015_mesh-config.md Records the revised edge configuration lifecycle.
docs/​configuration.md Updates configuration reference.
charts/​aether/​values.yaml Documents values behavior.
charts/​aether/​templates/​edge-namespace.yaml Adds the persistence marker.
charts/​aether/​templates/​edge-meshconfig.yaml Renders marked configurations every revision.
charts/​aether/​templates/​_helpers.tpl Determines persistent-manifest eligibility.
charts/​aether/​Chart.yaml Bumps the chart to 2.4.25.
charts/​aether/​BUILD.bazel Adds and updates template tests.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI balanced review requested due to automatic review settings October 9, 2026 18:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Downgrading through chart 2.4.24 can remove the namespace marker and reintroduce the Helm 3 rollback failure.

1 open finding

🧠 Review effort: Balanced

Comment thread charts/aether/templates/_helpers.tpl Resolved
…oo, so a pass through chart 2.4.24 does not lose it (#1514 review)

Chart 2.4.24 renders the edge Namespace without
aether.io/edge-meshconfig-in-manifest, so an upgrade to it (or a rollback to
one of its revisions) takes the marker off the Namespace, and it leaves the
live MeshConfig out of the manifest. With the Namespace's marker as the only
discriminator, every later 2.4.25 revision left the MeshConfig out as well,
and helm rollback to the original 2.4.25 revisions failed for good with 'no
MeshConfig with the name "default" found' (reproduced on kind, Helm 3.18.4).

The MeshConfig now carries the marker as well; 2.4.24 does not render it, so
it keeps it. Either marker is enough: the next upgrade to this chart renders
the MeshConfig again and marks the Namespace again. The Namespace's still
covers a MeshConfig that was deleted or replaced by hand.

What cannot be closed is documented: under Helm 3 a rollback straight from a
2.4.24 revision to a 2.4.25 one fails (the stored 2.4.24 manifest holds no
MeshConfig); an upgrade works.

e2e/first-install.sh, leg viii-b: through the published 2.4.24 chart (its
commit tag) and back, red first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The state-transition logic is documented and covered by focused template and cross-version rollback tests.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 9, 2026 20:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Cross-version Helm ownership and rollback semantics warrant final human review, and one runbook claim should be narrowed.

1 open finding

🧠 Review effort: Balanced

Comment thread docs/runbook.md Resolved
Copilot AI balanced review requested due to automatic review settings October 9, 2026 20:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The stateful Helm behavior is comprehensively handled, documented, and covered across supported Helm versions and version skew.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 9, 2026 20:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Stateful rollback behavior across Helm versions and historical chart revisions warrants final human validation despite the extensive coverage.

0 open findings

🧠 Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chart Helm charts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chart: helm rollback to a revision whose manifest holds a kept Namespace probably fails the same way as #1471

2 participants