Skip to content

feat: installOptions.existingCRDs controls CRDs already present on helm install - #2044

Merged
gianlucam76 merged 2 commits into
projectsveltos:mainfrom
gianlucam76:bug-2041
Oct 18, 2026
Merged

gianlucam76 merged 2 commits into
projectsveltos:mainfrom
gianlucam76:bug-2041

Conversation

@gianlucam76

Copy link
Copy Markdown
Member

On a fresh install the chart's crds/ were applied with server-side apply and force conflicts, silently overwriting (and possibly downgrading) CRDs that already existed in the cluster. This contradicts the SkipCRDs documentation ("installed if not already present") and Helm's own behavior for crds/.

Before helm install, create the CRDs of the chart (subcharts included) that are missing and tell Helm to skip its own CRD step. An existing CRD is never modified. Whether it differs from the chart's is decided with a server-side apply dry run. The new installOptions.existingCRDs field selects what to do with a differing one:

  • Skip (default): leave it as it is, log it and carry on
  • Fail: fail the installation naming the CRDs, creating nothing
  • Overwrite: previous behavior, Helm applies the chart's CRD

skipCRDs, DryRun and template-only runs are unchanged.

Fixes #2041

…lm install (projectsveltos#2041)

On a fresh install the chart's crds/ were applied with server-side apply
and force conflicts, silently overwriting (and possibly downgrading) CRDs
that already existed in the cluster. This contradicts the SkipCRDs
documentation ("installed if not already present") and Helm's own
behavior for crds/.

Before helm install, create the CRDs of the chart (subcharts included)
that are missing and tell Helm to skip its own CRD step. An existing CRD
is never modified. Whether it differs from the chart's is decided with a
server-side apply dry run. The new installOptions.existingCRDs field
selects what to do with a differing one:

- Skip (default): leave it as it is, log it and carry on
- Fail: fail the installation naming the CRDs, creating nothing
- Overwrite: previous behavior, Helm applies the chart's CRD

skipCRDs, DryRun and template-only runs are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…veltos#2041)

A fresh install of a chart whose crds/ already exist in the cluster with a
different definition now fails by default and reports the CRDs that differ,
so Sveltos never decides on behalf of the user whether to keep or replace a
CRD that may be owned by another tool. It matches what Helm 4 does by
default when the existing CRD has conflicting fields.

Users choose explicitly with installOptions.existingCRDs:
- Skip: leave the existing CRDs as they are and carry on
- Overwrite: apply the chart's CRDs over the existing ones

Releases that are already deployed are not affected, only fresh installs
go through this step.
@gianlucam76
gianlucam76 merged commit ef2da52 into projectsveltos:main Oct 18, 2026
12 checks passed
@gianlucam76
gianlucam76 deleted the bug-2041 branch October 18, 2026 16:41
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.

BUG: fresh helm install force-applies existing CRDs and can overwrite them with an older version (since Helm v4 / ServerSideApply change)

1 participant