-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Add CRD migrator, deprecate clusterctl upgrade CRD storage version migration #11889
base: main
Are you sure you want to change the base?
Conversation
645df3d
to
3187ed5
Compare
3187ed5
to
917e826
Compare
/test pull-cluster-api-e2e-main |
917e826
to
f1be095
Compare
f1be095
to
919c9a6
Compare
/test pull-cluster-api-e2e-main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are quite a few new files with the license stating 2024 as the year they were introduced, not sure if you wanted to update those, added a nit for one, left the others
bootstrap/kubeadm/main.go
Outdated
@@ -140,6 +144,9 @@ func InitFlags(fs *pflag.FlagSet) { | |||
fs.IntVar(&kubeadmConfigConcurrency, "kubeadmconfig-concurrency", 10, | |||
"Number of kubeadm configs to process simultaneously") | |||
|
|||
fs.StringVar(&skipCRDMigrationPhases, "skip-crd-migration-phases", "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered making this a string slice and allowing it to be specified with multiple values? Would all us to drop the All
and mean that if we add a third phase at some point this won't become awkward
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @fabriziopandini As you maybe have an additional opinion on this flag :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mostly added the All
to allow folks to entire disable the CRD migrator without worrying about the phases.
The current flag supports a comma-separated list, so in general All is also not required at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it can accept CSV then the string slice part of my comment isn't so important
I can see the argument for All
, though, do we want users to be conscious of new phases that we discover and acknowledge that they are skipping them?
I'm not entirely sure why anyone would skip the phases, they are an important part of the lifecycle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure why anyone would skip the phases, they are an important part of the lifecycle
I think this could be interesting if:
- folks want to use the storage version migrator from upstream k/k instead of our implementation here
- have another way to handle migration between apiVersions (also in general thinking about folks that don't run conversion webhooks, even though I don't exactly know how they handle all of this :))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok if we want make it a slice
I also think it is acceptable to ask users to be explicit in choosing what they want skip and thus dropping All (we also have only two phases, so it will not be a long list)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Made it a slice and dropped All
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not yet done with the review, but first finding
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
b313d99
to
d80ed62
Compare
/test pull-cluster-api-e2e-main |
d80ed62
to
4030bf0
Compare
/test pull-cluster-api-e2e-main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one nit and one future idea, otherwise lgtm.
Flake:
|
Not sure if it's a flake. Had the same error yesterday, improved the error message slightly. Now going to debug it though :) |
test/e2e/clusterctl_upgrade_test.go
Outdated
framework.ValidateCRDMigration(ctx, proxy, namespace, clusterName, | ||
func(crd apiextensionsv1.CustomResourceDefinition) bool { | ||
return strings.HasSuffix(crd.Name, ".cluster.x-k8s.io") && | ||
crd.Name != "providers.clusterctl.cluster.x-k8s.io" && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what we want to do with providers. At the moment it doesn't matter because it's v1alpha3 and we don't touch it at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe make it a overwritable func?
But also good enough to fixup once we start using it in a provider e2e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole thing is already overridable / configurable if a infra provider runs this test :)
What I meant with providers is the providers CRD. Currently I. did not configure any CRDMigrator to migrate the providers CRD (literally the CRD with the name: providers.clusterctl.cluster.x-k8s.io
)
Okay that was an easy fix // ClusterTopology feature is disabled via the CLUSTER_TOPOLOGY variable below,
// so we can't expect the CRD migrator to migrate the ClusterClass CRD.
crd.Name != "clusterclasses.cluster.x-k8s.io" |
/test pull-cluster-api-e2e-main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work, the integration test alone is a amazing.
bootstrap/kubeadm/main.go
Outdated
@@ -140,6 +144,9 @@ func InitFlags(fs *pflag.FlagSet) { | |||
fs.IntVar(&kubeadmConfigConcurrency, "kubeadmconfig-concurrency", 10, | |||
"Number of kubeadm configs to process simultaneously") | |||
|
|||
fs.StringVar(&skipCRDMigrationPhases, "skip-crd-migration-phases", "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok if we want make it a slice
I also think it is acceptable to ask users to be explicit in choosing what they want skip and thus dropping All (we also have only two phases, so it will not be a long list)
Findings should be all addressed. Thx everyone for the reviews! I'll run the e2e test locally to see what's going on there |
Should be hopefully green now /test pull-cluster-api-e2e-main |
@JoelSpeed @fabriziopandini @chrischdi e2e tests are now also all green. Findings should be addressed, PTAL :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we want to try and condense the CRD rbac by setting the resource name multiple times. It appears the RBAC generator doesn't do any sort of condensing of duplicate rules that only differ by resource name entries
/test pull-cluster-api-e2e-main |
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #11894