Skip to content

fix(velero): apply CRD updates on upgrade via CreateReplace - #3727

Merged
Aleksei Sviridkin (lexfrei) merged 1 commit into
mainfrom
fix/velero-upgrade-crds
Aug 10, 2026
Merged

fix(velero): apply CRD updates on upgrade via CreateReplace#3727
Aleksei Sviridkin (lexfrei) merged 1 commit into
mainfrom
fix/velero-upgrade-crds

Conversation

@lexfrei

@lexfrei Aleksei Sviridkin (lexfrei) commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What this PR does

Velero CRDs stayed frozen at whatever version was first installed: Helm never touches the chart's crds/ directory on upgrade, the generated HelmRelease left spec.upgrade.crds at the helm-controller default (Skip), and the package disables the upstream upgrade-crds Job. When the velero image moved to v1.18.1, which added the Queued and ReadyToStart backup phases, the apiserver rejected every phase transition against the stale CRDs (status.phase: Unsupported value: "Queued") and backups silently stopped while the HelmRelease stayed green.

This opts the velero PackageSource into upgradeCRDs: CreateReplace, the same policy mongodb-operator already uses, adds a platform test pinning it, and corrects the stale Job-disable rationale in the package. CreateReplace is safe here: velero only extends the phase enums between versions.

Closes #3726

Screenshots

Not a UI change.

Downstream repositories

Release note

fix(velero): apply Velero CRD updates on upgrade; previously CRDs stayed at their first-install version, so after the image moved to v1.18.1 backups could silently stop with `status.phase: Unsupported value: "Queued"` while the HelmRelease stayed green

Summary by CodeRabbit

  • New Features
    • Velero now automatically creates or replaces its Custom Resource Definitions during installation and upgrades.
  • Bug Fixes
    • Improved Velero CRD lifecycle handling to ensure updated definitions are applied reliably.
  • Tests
    • Added coverage verifying the CRD upgrade configuration and updated validation guidance.

velero evolves its CRD schema between versions; v1.18 adds the Queued
and ReadyToStart backup phases. Helm never upgrades CRDs shipped in
crds/, the generated HelmRelease left spec.upgrade.crds at the Skip
default, and the package disables the chart's upgrade-crds Job, so live
CRDs stayed frozen at first-install state: the server upgrades, the
apiserver rejects the new phases, and backups sit in New while the
HelmRelease stays green. Opt the velero PackageSource into
CreateReplace, consistent with mongodb-operator, add a platform test
pinning the policy, and correct the stale Job-disable rationale in the
package.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <3811295@gmail.com>
@lexfrei Aleksei Sviridkin (lexfrei) added the backport Should change be backported on previous release label Aug 10, 2026
@github-actions github-actions Bot added area/storage Issues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor) kind/bug Categorizes issue or PR as related to a bug size/M This PR changes 30-99 lines, ignoring generated files labels Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: fa9c91fc-29e6-4406-a462-d0fb9456d5a9

📥 Commits

Reviewing files that changed from the base of the PR and between ccd8a28 and f4d812c.

📒 Files selected for processing (4)
  • packages/core/platform/sources/velero.yaml
  • packages/core/platform/tests/sources_velero_crds_test.yaml
  • packages/system/velero/tests/velero_test.yaml
  • packages/system/velero/values.yaml

📝 Walkthrough

Walkthrough

Velero now sets upgradeCRDs: CreateReplace in its PackageSource. A platform test verifies the generated configuration. Velero comments and test rationale now describe HelmRelease-managed CRD lifecycle.

Changes

Velero CRD upgrade handling

Layer / File(s) Summary
Configure and test CRD upgrades
packages/core/platform/sources/velero.yaml, packages/core/platform/tests/sources_velero_crds_test.yaml
The Velero PackageSource enables CreateReplace CRD upgrades. The platform test verifies the generated setting.
Document HelmRelease CRD lifecycle
packages/system/velero/values.yaml, packages/system/velero/tests/velero_test.yaml
Comments now state that the generated HelmRelease manages CRDs from the chart during installation and upgrades.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: lllamnyp

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the Velero CRD upgrade fix and the CreateReplace setting.
Linked Issues check ✅ Passed The changes implement the linked issue by enabling CreateReplace, updating the rationale, and adding coverage for CRD upgrades.
Out of Scope Changes check ✅ Passed All changes support the linked issue through configuration, focused tests, and related documentation updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/velero-upgrade-crds

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lexfrei
Aleksei Sviridkin (lexfrei) merged commit efa7f5c into main Aug 10, 2026
23 of 24 checks passed
@lexfrei
Aleksei Sviridkin (lexfrei) deleted the fix/velero-upgrade-crds branch August 10, 2026 09:39
@github-actions

Copy link
Copy Markdown

Successfully created backport PR for release-1.6:

@github-actions

Copy link
Copy Markdown

Created backport PR for release-1.5:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-3727-to-release-1.5
git worktree add --checkout .worktree/backport-3727-to-release-1.5 backport-3727-to-release-1.5
cd .worktree/backport-3727-to-release-1.5
git reset --hard HEAD^
git cherry-pick -x f4d812cfb919496dfdfbca2ca8a3047a702d96cb
git push --force-with-lease

myasnikovdaniil added a commit that referenced this pull request Aug 18, 2026
…CreateReplace (#3728)

# Description
Backport of #3727 to `release-1.6`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/storage Issues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor) backport Should change be backported on previous release backport-previous Backport target — previous release line kind/bug Categorizes issue or PR as related to a bug size/M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

velero CRDs are never updated after the initial install, backups silently stop when the image adds new phases

3 participants