-
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
ClusterClass Upgrade Fails Due to ManagedFields Behavior Change in CAPI v1.6 → v1.8 #11857
Comments
I wonder if this is similar to #11773 |
Indeed, this is what I found: Specifically, this commit explicitly says:
So since things are tracked individually, that's exactly what's happening then. Now, we need to figure out how to workaround that.. |
After further investigation, I found that the change in Steps to Reproduce
|
I think #11773 is different and I would keep it out of this issue to avoid confusion. Yes we intentionally added "name" as a map key to allow tracking separate ownership per variable. I'm not sure if there is something that we can do within Cluster API. This seems to be due to how the kube-apiserver handles schema changes in managedFields. I wonder if more recent kube-apiserver versions might have improved or changed that behavior though (very likely not). |
Please see the discussion here in Slack: https://kubernetes.slack.com/archives/C0EG7JC6T/p1738861392254669 It's not exactly the same topic, but it's potentially relevant. See also the linked PR here:
(not sure in which Kubernetes version that landed) |
@sbueringer does this mean we're missing EDIT: I might be wrong, |
No. We intentionally moved from atomic to x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
exactly The PR I linked above might have improved some cases in which the apiserver after the PR handled schema transitions better |
/priority important-soon At least for documenting the issue. For other points let's see where the dicussion leads to. /triage accepted |
What steps did you take and what happened?
I encountered an issue when upgrading a Cluster to use a new ClusterClass after migrating from CAPI v1.6 → v1.8. The upgrade fails because old variables persist in
spec.topology.variables
, even though they should have been removed by Server-Side Apply (SSA).Steps to Reproduce
Create an initial ClusterClass (
oldClass
)oldVariable
.Create a Cluster using
oldClass
spec.topology.variables
includesoldVariable
.Create a new ClusterClass (
newClass
)newClass
has a required variablenewVariable
instead ofoldVariable
.Upgrade the cluster to use
newClass
via SSA patcholdVariable
should be removed, andnewVariable
should be added.Scenarios Tested
✅ Scenario 1: Running on CAPI v1.6.x
Deployment Versions:
Result:
newVariable
exists, andoldVariable
is removed.✅ Scenario 2: Running on CAPI v1.8.x
Deployment Versions:
Result:
newVariable
exists, andoldVariable
is removed.❌ Scenario 3: Upgrading from CAPI v1.6 → v1.8 and then upgrading ClusterClass
newClass
(SSA patch).oldVariable
still exists, despite not being defined innewClass
.What did you expect to happen?
Cluster API version
I mentioned the cluster-api versions in the scenario above.
Kubernetes version
I tested in these versions.
1.25.x
1.28.x
Anything else you would like to add?
What I Found
managedFields
behaves differently between versions.spec.topology.variables
was tracked as a single field:spec.topology.variables
is individually tracked:Hypothesis:
spec.topology.variables
.Possible Causes
spec.topology.variables
between CAPI v1.6 → v1.8.Label(s) to be applied
/kind bug
One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels.
The text was updated successfully, but these errors were encountered: