Repository navigation
fix(chart, e2e): the seeded MeshConfig is a hook, so helm rollback to a release's first revision works (#1471) - #1513
Merged
Conversation
… a release's first revision works (#1471) The chart seeds the default MeshConfig once and never renders it again. As a release object it was in the first revision's manifest only, and still live: helm rollback to that revision failed with 'no MeshConfig with the name "default" found', because Helm patches a live object of the target manifest from the current manifest's copy and there is none. The seed is now a pre-install,pre-upgrade hook, in no revision's manifest. It stays a release object on the one revision that also creates the namespace it goes into (a pre-install hook runs before that namespace exists). Template tests seen red first; e2e/first-install.sh gains a rollback leg. Chart aether 2.4.21 -> 2.4.24. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
There was a problem hiding this comment.
🟡 Changes recommended
The operator documentation incorrectly limits legacy failures to revision 1 and misstates retained objects’ ownership annotations.
4 open findings
What changed in this PR
Moves seeded MeshConfig resources to Helm hooks so first-revision rollbacks succeed without replacing operator-managed configuration.
Changes:
- Adds conditional
pre-install,pre-upgradehooks. - Adds template and end-to-end rollback coverage.
- Updates chart version and operator documentation.
| File | Description |
|---|---|
charts/aether/templates/_helpers.tpl |
Determines hook versus release-object seeding. |
charts/aether/templates/controller-meshconfig.yaml |
Hooks the control-plane seed. |
charts/aether/templates/edge-meshconfig.yaml |
Hooks the edge seed where possible. |
charts/aether/BUILD.bazel |
Adds Helm template tests. |
charts/aether/Chart.yaml |
Bumps chart to 2.4.24. |
charts/aether/values.yaml |
Documents seeding behavior. |
e2e/first-install.sh |
Tests rollback and reseeding. |
docs/configuration.md |
Updates configuration reference. |
docs/proposals/015_mesh-config.md |
Records the design change. |
docs/runbook.md |
Adds upgrade and rollback guidance. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…fig, not always the first (#1471 review) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…ce leg Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…between the render and the hook is left alone (#1471) A hook with no helm.sh/hook-delete-policy gets before-hook-creation: Helm deletes the live object of that name before creating the hook's. The lookup that decides to render the seed and the hook are not atomic, so a MeshConfig created in between was deleted and replaced by the seed, with the upgrade reporting success (measured on kind, Helm 3.18.4 and 4.2.0). The hook now carries helm.sh/hook-delete-policy: never, a value Helm does not act on. hook-failed was measured too and rejected: under Helm 4's server-side apply it deletes the operator's object when the wait after the apply fails. With never the upgrade fails on "already exists" (or goes through with the object in place) and succeeds when run again. e2e/first-install.sh gets leg v-a2, which holds an upgrade between the render and the seed hook with a slow pre-upgrade hook and creates a MeshConfig there. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
# Conflicts: # charts/aether/Chart.yaml # docs/runbook.md
…d to a MeshConfig created during the upgrade, not skipped (#1471) The delete policy stops every deletion, but it does not make the seed create-only: measured with Helm 4.2.0, a seed with tracingEnabled=true over an object created in the window that set only accessLogsEnabled left both set. The helper comment, the test comment, values.yaml, docs/configuration.md and the runbook said the object was left alone; they now say what is merged in and when the spec can change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
This was referenced Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Closes #1471
An agent wrote this pull request.
What was wrong
The chart seeds the
defaultMeshConfig once (alookupskips it when one is live) and never renders it again, so that operators own it. As an object of the release it was in the manifest of the one revision that created it (normally the first; a later one when an upgrade found the object absent), in no later manifest, and still live (helm.sh/resource-policy: keep).helm rollbackto that revision,helm rollback <release> 1on nearly every release, then fails:Measured (kind, Kubernetes v1.35.8, Helm 3.18.4, the chart on
main): install, an edit of the MeshConfig, upgrade,helm rollback aether 1. Revision 1's manifest holds one MeshConfig, revision 2's none; the rollback fails with the message above and leaves the releasefailedat revision 3;helm rollback aether 2then succeeds.Read in Helm 3.18.4 (
pkg/kube/client.go,Update): for each object of the target manifest that is live, Helm takes the copy in the current manifest as the starting point of its patch and returns this error when there is none.helm upgradedoes not hit it because it first adopts live objects that carry the release's ownership annotations;helm rollbackhas no such step. No hook ordering is involved.The fix
The seed is a Helm hook,
helm.sh/hook: pre-install,pre-upgrade, so it is in no revision's manifest. Thelookupguard is unchanged: the seed is rendered only when no MeshConfig is live.pre-, notpost-: the agent pod stays inContainerCreatinguntil the controller has projected the MeshConfig into a ConfigMap, so under--waita post-install hook would never run.pre-upgradeas well: an upgrade that finds the MeshConfig absent seeds it, as before.helm.sh/hook-delete-policy: never, so that the hook deletes nothing.neveris not a policy Helm knows; see the next section for why it is there and nothook-failed.pre-installhook runs before any object of the release exists, so it cannot create a MeshConfig in a namespace that the same revision creates. On that one revision (the edge's MeshConfig withedge.namespaceCreate=true, its default once the edge is on; the control plane's withnamespace.create=true) the seed is still a release object, and that revision still cannot be rolled back to once a later one exists. Rendering it as a hook there would fail the install. See "Not fixed" below.helm.sh/resource-policy: keepstays on the object: it is what protects it in the exception above, and on objects older charts created.The hook's delete policy (review round 2)
A hook with no
helm.sh/hook-delete-policygets Helm's default,before-hook-creation: Helm deletes the live object of that name just before it creates the hook's. Thelookuponly says the MeshConfig was absent when the chart was rendered; the hook runs later. The review asked forhook-failed. Each candidate was measured on kind (Kubernetes v1.35.8, the real chart and images, the controller running) with Helm 3.18.4 and with Helm 4.2.0, which is the version this repository's Bazel toolchain pins. The race was made deterministic with a scratch copy of the chart holding one morepre-upgradehook of a lower weight (a Pod that sleeps 15 s): the MeshConfig is deleted, the upgrade starts, and once the sleeper is running (so the chart is rendered, with the seed in it) a MeshConfig with its own spec is created withkubectl create.hook-succeededhook-failednever(chosen)helm get hooks, not in the manifesthelm get hooksof that revision holds no MeshConfig); same UID, edit kepthelmexits 0, releasedeployedmeshconfigs.config.aether.io "default" already exists; object untouched (same UID, spec, no Helm annotation)hook-failedhelm)hook-failedmeshConfig.proxy.tracingEnabled=trueover an object with onlyaccessLogsEnabled: true; review round 3)Apply failed with 1 conflict; object untouchedAfter every failed upgrade above the release is
failedat a new revision with the previous revision stilldeployed, and a plain re-run of the samehelm upgradesucceeds (the object is live, so the seed is not rendered); in thehook-failedrow where the object was deleted, the re-run seeds the default.Read in Helm (
pkg/action/hooks.go, 3.18.4 and 4.2.0): the annotation's values are stored as given and compared with the three known policies, so any value turns the default off and an unknown one matches no deletion step.hook-failedis applied only when the wait after a successful creation fails. Helm 3 creates client side, so that object is always the seed, and does not wait on a MeshConfig at all. Helm 4 applies hooks server side, an apply over an existing object succeeds, and the object deleted after a failed wait is then the operator's.The choice:
never. An upgrade that fails loudly and is fixed by running it again is better than a silent replacement, and bothhook-failedandnevergive that. Buthook-failedkeeps one measured path that deletes the operator's object, andneverhas none. Whatnevercosts is that it relies on Helm ignoring a value it does not know, which is read in the source of both versions and measured, not documented.helm lint --strictpasses with it on both. If a later Helm rejects or reinterprets it, the template tests (rendered with the pinned Helm) and the new e2e leg fail first. If the owner prefers the documented value, it is a one-word change in two templates and one test constant; the trade is the row marked d+e.Render, before and after (chart version held equal,
--set controller.webhook.spire=true)edge.enabled=trueedge.enabled=true,edge.namespaceCreate=falsemeshConfig.createDefault=false,edge.enabled=trueNo pod template changes.
What an operator sees on upgrade
Nothing rolls and nothing in the cluster changes: the MeshConfig is live, so it is not rendered, as before.
Measured on kind, a release installed and upgraded by the chart on
main, then upgraded to this chart: the six workloads keepgeneration=1, the MeshConfig keeps its UID, generation and the edit.helm upgradeto revision 1's chart with revision 1's values (helm get values --revision 1 -o yaml, passed with-f), which also recovers a release the failed rollback leftfailed.helm get manifestno longer lists the MeshConfig (helm get hooksdoes, on the revision that seeded it), and the object carries nometa.helm.sh/release-*annotations.helm uninstallleaves it behind, as it left the kept object behind (measured).helm install --no-hooksseeds no MeshConfig.Error: UPGRADE FAILED: pre-upgrade hooks failed: ... meshconfigs.config.aether.io "default" already exists. Nothing of the release has changed at that point (pre-upgradehooks run first) and the MeshConfig is untouched. Run the same command again. With Helm 4 and server-side apply the upgrade goes through instead and the object gains the chart's labels and hook annotations. The runbook section has both.Also measured with this chart on kind: a fresh
helm upgrade --install --waitcompletes (19 s); a deleted MeshConfig is seeded again by the next upgrade, as a hook; with the edge on and its namespace made by the operator, both MeshConfigs are hooks and rollback to revision 1 succeeds.Tests, red first
Template tests in
charts/aether/BUILD.bazel, run against the templates onmainbefore the fix: 4 fail, 4 pass.mainaether_meshconfig_seed_is_a_hook_test(default)aether_meshconfig_seed_hook_carries_the_seed_values_test(operator override)aether_edge_meshconfig_seed_is_a_hook_testaether_edge_meshconfig_seed_created_namespace_testaether_meshconfig_seed_off_{default,edge}_test(off switch)aether_meshconfig_seed_created_namespace_test(guard)aether_meshconfig_seed_is_the_only_hook_test(guard)e2e:
e2e/first-install.shgets leg v-a after the upgrade. It edits the MeshConfig, runshelm rollback aether 1andhelm rollback aether 2, and asserts the release isdeployedeach time, the MeshConfig is the same object with the edit in it, and no revision's manifest holds a MeshConfig. Then it deletes the MeshConfig, upgrades, and asserts it is seeded again outside the manifest and that a rollback to that revision leaves it alone. Run locally with this branch's script against the charts onmain:and against this branch, where the whole suite passes (the legs before and after v-a included):
Round 2 (the delete policy). The four tests marked FAILED above match the annotations block whole; with
helm.sh/hook-delete-policy: neveradded to what they expect and the templates not yet changed, the same four failed again (191 pass, 4 fail), and they pass with the templates changed. The two "created namespace" tests also hold that a seed rendered as a release object carries no hook annotation of any kind.e2e/first-install.shgets leg v-a2, the race of row d as a regression test: a copy of the chart with a slowpre-upgradehook ahead of the seed (a Pod that sleeps, on kube-proxy's image, which every node has), a MeshConfig created while that hook runs, and the assertion that it is the same object with its spec afterwards. It accepts either honest outcome (the upgrade fails on "already exists" and then succeeds when run again, or goes through) and fails on a deletion or a replacement. With this branch's script against the chart as it was before this round:and against this branch (the whole suite passes, Helm 3.18.4):
bazel test //charts/... //e2e/...: 240 pass. The lint build andmake format-checkpass.Not fixed, and not verified
edge.enabled=trueat defaults: revision 1's manifest holds the edge's MeshConfig andhelm rollback aether 1fails as before. The runbook says how to check a revision, how to get round it, and how to avoid it (edge.namespaceCreate=falsewith a namespace you made).neverstops every deletion, but the hook is an apply there, so in the race the seed is merged into the object created in the window: chart labels, hook annotations, and anymeshConfig.proxyfield the object does not set. With the default, emptymeshConfig.proxythe spec does not change; with Helm 3 the object is untouched. Closing it needs a seed that is created and never applied, such as a hook Job running a create with its own ServiceAccount, RBAC and image. That is a new workload in the chart and is left as a decision for the owner; the comments,values.yaml,docs/configuration.mdand the runbook now say what happens. The e2e leg runs under Helm 3 and cannot see this case.e2e/first-install.shdoes not run under Helm 4 as it is (it callshelm list -a, a flag Helm 4 no longer has), which is older than this pull request and not changed here.neveris not a documented value ofhelm.sh/hook-delete-policy. That Helm ignores it is read in the source of 3.18.4 and 4.2.0 and measured with both; no other Helm version was tried.helm templateand applies the result has no cluster to look the MeshConfig up in. It rendered the seed on every sync before, and still does, now with the hook annotation on it. How such a tool treats that annotation was not tried; the docs say to setmeshConfig.createDefault=falsethere.first-installjob has not run with this leg; it was run locally only.Chart version
aether→ 2.4.24.mainis at 2.4.22 (merged into this branch); open pull request #1495 takes 2.4.23, so a one-lineChart.yamlconflict is expected if it merges first.🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr