-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Topology controller should not take ownership of cluster.spec.topology #6736
Labels
area/clusterclass
Issues or PRs related to clusterclass
kind/bug
Categorizes issue or PR as related to a bug.
Comments
/area topology I think a fix should get cherry picked to v1.2 |
#6738 implements option 1:
Cons of option 2 and current implementation:
Edit: option 1 does not work out out of the box, because |
#6739 implements option 2 which simply extends the behaviour already done for |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/clusterclass
Issues or PRs related to clusterclass
kind/bug
Categorizes issue or PR as related to a bug.
What steps did you take and what happened:
Checked output of
pull-cluster-api-e2e-full-main
:https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/directory/pull-cluster-api-e2e-full-main/1540324488158121984
Especially the cluster object and the resulted managed fields, the interesting part:
[0]
The interesting part here is the co-ownership of the path
spec.topology
and fields bellow.These are fields which are normally read as input for computing the desired state and are normally never written by the topology controller.
The same may apply to the following paths but need to be verified:
.spec.paused
spec.clusterNetwork
The issue is: if the topology controller reconciles and at the same time another controller or user changes one of the co-owned fields, the topology controller may overwrite the changed data.
E.g.:
Cluster.spec.topology.workers.machineDeployments[0].replicas == 3
)Cluster.spec.topology.workers.machineDeployments[0].replicas = 100
and patches it to the api serverCluster.spec.topology.workers.machineDeployments[0].replicas == 3
What did you expect to happen:
Topology controller does not overwrite cluster fields which it is not supposed to write to.
Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
patchEngine.Apply
adjust computeCluster in topology controllers
desired_state.go
:As alternative
computeCluster
atcluster-api/internal/controllers/topology/cluster/desired_state.go
Line 406 in 5c44a14
to only contain set the relevant paths supposed to get set via topology controller:
metadata.labels
cluster.Spec.InfrastructureRef
cluster.Spec.ControlPlaneRef
as well ass other required metadata
metadata.name
metadata.namespace
This could be adjusted by adding the unrelated fields to the ignorePaths at:
cluster-api/internal/controllers/topology/cluster/reconcile_state.go
Line 442 in 5c44a14
xref: issue discovered while testing dry-run server side apply at #6710 but should potentially already affect main.
Environment:
kubectl version
):/etc/os-release
):/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: