Skip to content

Read the DatastoreMigration CRD at v1 - #5127

Open
caseydavenport wants to merge 3 commits into
tigera:masterfrom
caseydavenport:casey-migration-crd-v1
Open

Read the DatastoreMigration CRD at v1#5127
caseydavenport wants to merge 3 commits into
tigera:masterfrom
caseydavenport:casey-migration-crd-v1

Conversation

@caseydavenport

Copy link
Copy Markdown
Member

The DatastoreMigration CRD is moving to migration.projectcalico.org/v1 in Calico. Points the operator at v1, and keeps a v1beta1 group/version around for the version check only, so a cluster that migrated on v3.32 is still recognized as migrated after upgrading.

Two TODO: remove in v3.34 markers go in with it, for when v3.32 is out of support.

The group/version was previously spelled out in a few places; there's one constant for it now.

Related: CORE-12573

None

The group/version was hardcoded in five places. Derive them all from
SchemeGroupVersion (now v1) so the next bump is a one-liner.

checkDatastoreMigration falls back to v1beta1 on NotFound, because a
cluster that migrated on v3.32 would otherwise be misread as
unmigrated: the v1 lookup misses, discovery still sees both API
groups, and UseV3CRDS answers "use v1 CRDs".
Drop a redundant nil check, make legacyDatastoreMigrationGVR a var
for symmetry with datastoreMigrationGVR, and fix a comment that
implied deleting the DatastoreMigration CR removes the crd.projectcalico.org
CRDs (it doesn't, they're independent). Also updates checkDatastoreMigration's
doc comment to mention the v1beta1 fallback, and switches the fallback
test's injected error to NewGenericServerResponse so it matches the 404
shape the real apiserver produces instead of a Status-shaped NotFound.

Adds a comment on the installation and apiserver controllers' watch
registration explaining why it's v1-only with no v1beta1 fallback:
upgrading a v3.32-migrated cluster requires deleting the old CRD
first, which cascades to the DatastoreMigration CR, so there's no CR
left to watch after a supported upgrade.
@caseydavenport
caseydavenport force-pushed the casey-migration-crd-v1 branch from ace1e63 to ac66c89 Compare July 30, 2026 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants