Regression: "rollback for missing resources" fix (#31412) is absent from the 4.1.x line - helm rollback fails on all of 4.1.x (works in 4.0.5 and 4.2.0+)
What happened?
PR #31412 ("Fix rollback for missing resources", fixes #13437) makes helm rollback succeed when a resource is present in the cluster AND in the target manifest but missing from the current/original release manifest: it uses the live cluster object as the 3-way-merge baseline, logging "resource exists on cluster but not in original release, using cluster state as baseline".
That behaviour works in 4.0.5 and again in 4.2.0+, but is missing from the entire 4.1.x release line. On 4.1.x the same scenario fails with:
Error: original object ConfigMap with the name "cm" not foundThe error string is the one introduced together with #31412, but the cluster-state-baseline fallback does not take effect on 4.1.x - i.e. the fix did not make it into the 4.1.x branch (regression). It is (re-)present in 4.2.0 (commit 374aeb4, seen in https://github.com/helm/helm/compare/v4.1.0...v4.2.0 ).
| Helm | Result |
|---|---|
| 4.0.5 | SUCCESS ("using cluster state as baseline") |
| 4.1.0 (first 4.1.x) | FAIL ("original object ConfigMap ... not found") |
| 4.1.1 | FAIL (same) |
| 4.1.4 (latest 4.1.x) | FAIL (same) |
| 4.2.0 | SUCCESS |
| 4.2.2 | SUCCESS |
4.1.0 (first), 4.1.1 and 4.1.4 (latest) were all tested and all fail -> the whole 4.1.x line is affected.
Note:- Every run used the same kubernetes cluster and same kubectl client
What did you expect to happen?
#31412 shipped in 4.0.5 (a supported patch line) and in 4.2.0, so the 4.1.x line should contain it too. A rollback that succeeds on 4.0.5 must not regress on 4.1.x. Please backport #31412 into a 4.1.x patch
Is the fix already available on the Helm 3.x line?
How can we reproduce it (as minimally and precisely as possible)?
1. Chart v1 with a ConfigMap
mkdir -p mychart/templates cat > mychart/Chart.yaml <<YAML apiVersion: v2 name: mychart version: 0.1.0 YAML cat > mychart/templates/cm.yaml <<YAML apiVersion: v1 kind: ConfigMap metadata: name: cm data: foo: bar YAML
2. Install (revision 1)
kubectl create namespace demo helm install demo ./mychart -n demo
3. Remove the ConfigMap in v2 and upgrade (revision 2) -> Helm prunes it
rm mychart/templates/cm.yaml helm upgrade demo ./mychart -n demo kubectl get configmap cm -n demo # NotFound (pruned)
4. Re-create the object out-of-band (operator/backup-restore)
kubectl create configmap cm -n demo --from-literal=foo=bar
5. Roll back to revision 1 (which DID contain the ConfigMap)
helm rollback demo 1 -n demo
- 4.0.5 / 4.2.0+: "Rollback was a success!"
- all 4.1.x: Error: original object ConfigMap with the name "cm" not found
Helm version
$ helm version # FAIL build (representative of all 4.1.x)
version.BuildInfo{Version:"v4.1.4", GitCommit:"05fa37973dc9e42b76e1d2883494c87174b6074f", GoVersion:"go1.25.9", KubeClientVersion:"v1.35"}
$ helm version # PASS builds
version.BuildInfo{Version:"v4.0.5", GitCommit:"1b6053d48b51673c5581973f5ae7e104f627fcf5", GoVersion:"go1.25.5", KubeClientVersion:"v1.34"}
version.BuildInfo{Version:"v4.2.2", GitCommit:"b05881cf967a5a09e19866799d0edfd40675803a", GoVersion:"go1.26.4", KubeClientVersion:"v1.36"}
Kubernetes version
Not applicable.
The testing was done on the same kubernetes cluster and the same kubectl client.
Source: helm/helm