Skip to content

fix: skip recreatePods on Helm 4, which removed --recreate-pods - #2832

Merged
yxxhero merged 2 commits into
helmfile:mainfrom
Cayan:fix-recreate-pods-helm4
Oct 16, 2026
Merged

yxxhero merged 2 commits into
helmfile:mainfrom
Cayan:fix-recreate-pods-helm4

Conversation

@Cayan

@Cayan Cayan commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Helm 4 removed --recreate-pods (helm/helm#31023), and there is no replacement flag. helmfile still passed it for any release with recreatePods: true, set on the release or in helmDefaults, so helmfile sync and apply failed on Helm 4 with Error: unknown flag: --recreate-pods.

On Helm 4, flagsForUpgrade now leaves the flag out and logs a warning that names the release. Helm 3 still gets it.

Why warn instead of error: forceConflicts and rollbackOnFailure error on Helm 3 because they are new options that have no meaning there. force and atomic are older options that get translated for Helm 4. recreatePods is an older option with nothing to translate to, so dropping it with a warning keeps one helmDefaults block working for users on both versions, the same way --color is skipped with a warning for unittest on Helm 4. Helm's own docs suggest a checksum annotation on the pod template instead.

Tests:

  • recreate-pods-helm4 and recreate-pods-from-default-helm4 cases in the flagsForUpgrade table.
  • The existing recreate-pods cases are pinned to Helm 3.10.0. Without a version they follow the installed helm binary, so on a Helm 4 machine they would take the new branch.
  • A test that the warning is logged on Helm 4 and not on Helm 3.

Checked end to end with Helm 4.2.3 and an empty kubeconfig: before, sync failed on the unknown flag; after, it prints the warning and only fails later on the unreachable cluster, the same as a release without recreatePods.

The configuration docs note that the setting is ignored on Helm 4.

- Helm 4 removed `--recreate-pods` (helm/helm#31023) and fails with "unknown flag", so a release
  with `recreatePods: true` broke `sync` and `apply`. On Helm 4 the flag is now left out with a
  warning; Helm 3 still receives it.
- The upgrade flag tests gain Helm 4 cases, and the existing ones are pinned to Helm 3 so they no
  longer depend on the installed helm binary.
- A test checks that the warning names the release on Helm 4 and is not logged on Helm 3.
- The configuration docs note that recreatePods is ignored on Helm 4.

Signed-off-by: Cayan <[email protected]>
Drop the nested if-in-if and the st.logger nil-guard: no other log call in
state.go nil-checks the logger (e.g. the --color Helm 4 skip). Compute
recreatePodsEnabled and branch via a tagless switch, matching the switch
style already used elsewhere in state.go: warn on Helm 4, append
--recreate-pods otherwise. The flagsForUpgrade table runner now uses the
shared discard logger so the Helm 4 recreate-pods cases log safely.

Signed-off-by: yxxhero <[email protected]>
@yxxhero
yxxhero force-pushed the fix-recreate-pods-helm4 branch from 79457ac to 3c33a3c Compare October 16, 2026 00:01
@yxxhero
yxxhero merged commit 8fc23a4 into helmfile:main Oct 16, 2026
17 checks passed
hbjydev pushed a commit to hbjydev/phoebe that referenced this pull request Oct 20, 2026
…) (#902)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [aqua:helmfile/helmfile](https://github.com/helmfile/helmfile) | tools | patch | `1.8.1` → `1.8.2` |

---

### Release Notes

<details>
<summary>helmfile/helmfile (aqua:helmfile/helmfile)</summary>

### [`v1.8.2`](https://github.com/helmfile/helmfile/releases/tag/v1.8.2)

[Compare Source](helmfile/helmfile@v1.8.1...v1.8.2)

#### What's Changed

- fix: support escaped commas in --state-values-set by [@&#8203;ban11111](https://github.com/ban11111) in [#&#8203;2813](helmfile/helmfile#2813)
- add trackLogsUntilReady flag by [@&#8203;pznamensky](https://github.com/pznamensky) in [#&#8203;2814](helmfile/helmfile#2814)
- feat: dir= selector for path-based release filtering and traversal skip by [@&#8203;dschmidt](https://github.com/dschmidt) in [#&#8203;2609](helmfile/helmfile#2609)
- build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.113.4 to 1.114.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2818](helmfile/helmfile#2818)
- build(deps): bump github.com/sashabaranov/go-openai from 1.42.1 to 1.43.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2819](helmfile/helmfile#2819)
- build(deps): bump go.opentelemetry.io/otel/sdk/metric from 1.46.0 to 1.47.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2815](helmfile/helmfile#2815)
- build(deps): bump gitpython from 3.1.59 to 3.1.62 in /docs by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2820](helmfile/helmfile#2820)
- build(deps): bump golang.org/x/sync from 0.23.0 to 0.24.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2827](helmfile/helmfile#2827)
- add trackLogsInterval option by [@&#8203;pznamensky](https://github.com/pznamensky) in [#&#8203;2825](helmfile/helmfile#2825)
- build(deps): bump github.com/hashicorp/go-getter/v2 from 2.2.4 to 2.2.5 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2821](helmfile/helmfile#2821)
- build(deps): bump go.opentelemetry.io/proto/otlp from 1.11.0 to 1.11.1 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2822](helmfile/helmfile#2822)
- build(deps): bump go.opentelemetry.io/contrib/exporters/autoexport from 0.71.0 to 0.72.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2823](helmfile/helmfile#2823)
- build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.114.0 to 1.114.3 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2828](helmfile/helmfile#2828)
- build(deps): bump github.com/mattn/go-runewidth from 0.0.30 to 0.0.31 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2829](helmfile/helmfile#2829)
- build(deps): bump golang.org/x/term from 0.46.0 to 0.47.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2830](helmfile/helmfile#2830)
- build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.33.6 to 1.33.9 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2831](helmfile/helmfile#2831)
- build(deps): bump github.com/gookit/color from 1.6.1 to 1.6.2 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2833](helmfile/helmfile#2833)
- fix: skip recreatePods on Helm 4, which removed --recreate-pods by [@&#8203;Cayan](https://github.com/Cayan) in [#&#8203;2832](helmfile/helmfile#2832)
- chore: bump Helm to v3.22.1 and v4.3.1 by [@&#8203;yxxhero](https://github.com/yxxhero) in [#&#8203;2834](helmfile/helmfile#2834)
- fix: propagate --oci-plain-http to chartify for all chart-preparing commands by [@&#8203;yxxhero](https://github.com/yxxhero) in [#&#8203;2826](helmfile/helmfile#2826)

**Full Changelog**: <helmfile/helmfile@v1.8.1...v1.8.2>

</details>

---

### Configuration

📅 **Schedule**: (in timezone Europe/London)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNjcuNSIsInVwZGF0ZWRJblZlciI6IjQ0LjE2Ny41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL3BhdGNoIl19-->

Reviewed-on: https://git.hayden.moe/hayden/phoebe/pulls/902
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.

2 participants