Skip to content

fix: allow helm upgrade force to actually apply#1876

Merged
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:helm-force
Jul 15, 2026
Merged

fix: allow helm upgrade force to actually apply#1876
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:helm-force

Conversation

@gianlucam76

Copy link
Copy Markdown
Member

Before this PR that was conflicting with server-side apply

getHelmUpgradeClient also unconditionally set ServerSideApply and ForceConflicts on every upgrade. The Helm SDK rejects that combination outright:

invalid operation: cannot use force conflicts and force replace together

so the force option could never actually run. Any upgrade that set it failed immediately, before Helm even attempted the patch.

This surfaces for instance when a chart changes a Deployment's strategy.type from unset, defaulted by the API server to RollingUpdate to Recreate. The live object still carries the server-defaulted rollingUpdate values, which the API server now rejects as forbidden alongside Recreate. A normal server-side apply patch can't clear a field it never owned, so the upgrade is stuck. force (delete+recreate) is the intended escape hatch, but it was unusable.

Now ServerSideApply/ForceConflicts are only enabled when force is not set; when force is set, both are disabled so ForceReplace can proceed as Helm expects.

Before this PR that was conflicting with server-side apply

`getHelmUpgradeClient` also unconditionally set `ServerSideApply` and
`ForceConflicts` on every upgrade. The Helm SDK rejects that combination
outright:

```
invalid operation: cannot use force conflicts and force replace together
```

so the `force` option could never actually run. Any upgrade that set it
failed immediately, before Helm even attempted the patch.

This surfaces for instance when a chart changes a Deployment's
`strategy.type` from unset, defaulted by the API server to `RollingUpdate`
to `Recreate`. The live object still carries the server-defaulted
`rollingUpdate` values, which the API server now rejects as forbidden
alongside `Recreate`. A normal server-side apply patch can't clear a field
it never owned, so the upgrade is stuck. `force` (delete+recreate) is the
intended escape hatch, but it was unusable.

Now `ServerSideApply`/`ForceConflicts` are only enabled when `force` is not
set; when `force` is set, both are disabled so `ForceReplace` can proceed as
Helm expects.
@gianlucam76 gianlucam76 merged commit ed22929 into projectsveltos:main Jul 15, 2026
11 checks passed
@gianlucam76 gianlucam76 deleted the helm-force branch July 15, 2026 19:46
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