Read the DatastoreMigration CRD at v1 - #5127
Open
caseydavenport wants to merge 3 commits into
Open
Conversation
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
force-pushed
the
casey-migration-crd-v1
branch
from
July 30, 2026 22:44
ace1e63 to
ac66c89
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The DatastoreMigration CRD is moving to
migration.projectcalico.org/v1in 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.34markers 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