Skip to content
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 ClusterClass generation check to Cluster Topology reconciler #8023

Merged

Conversation

killianmuldoon
Copy link
Contributor

Add a check to the Cluster Topology reconciler to stop reconciling if the ClusterClass is not up to date. This check relies on the observedGeneration field added in #7987.

Part of #7985

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 30, 2023
Copy link
Contributor Author

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/hold
contains #7954 and shouldn't be merged until that is merged.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 30, 2023
@killianmuldoon killianmuldoon mentioned this pull request Jan 30, 2023
34 tasks
@killianmuldoon killianmuldoon force-pushed the pr-exvars-generation-check branch 3 times, most recently from af5a423 to a1bc637 Compare January 31, 2023 13:17
@killianmuldoon killianmuldoon force-pushed the pr-exvars-generation-check branch 3 times, most recently from cc88cbb to 4fe86dd Compare January 31, 2023 16:24
@killianmuldoon
Copy link
Contributor Author

/retest

Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Last round of nits from my side.

@killianmuldoon killianmuldoon force-pushed the pr-exvars-generation-check branch 2 times, most recently from a401eac to 24b7117 Compare February 1, 2023 10:36
@sbueringer
Copy link
Member

Last one: #8023 (comment) otherwise lgtm from my side

@killianmuldoon killianmuldoon force-pushed the pr-exvars-generation-check branch from 24b7117 to 7c01fcc Compare February 1, 2023 11:25
@sbueringer
Copy link
Member

lgtm pending underlying PR is merged + rebase

Copy link
Contributor

@ykakarap ykakarap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Just nits.

@killianmuldoon killianmuldoon force-pushed the pr-exvars-generation-check branch from 7c01fcc to e178cd7 Compare February 2, 2023 15:51
@sbueringer
Copy link
Member

lgtm pending underlying PR is merged + rebase

clusterClass := &clusterv1.ClusterClass{}
key := client.ObjectKey{Name: s.Current.Cluster.Spec.Topology.Class, Namespace: s.Current.Cluster.Namespace}
if err := r.Client.Get(ctx, key, clusterClass); err != nil {
return ctrl.Result{}, errors.Wrapf(err, "failed to retrieve ClusterClass %s", s.Current.Cluster.Spec.Topology.Class)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: should we surface this use case in the topology reconcile condition given that we are accepting clusters without a corresponding ClusterClass?
This will make it easier for users to detect cases where e.g. they made a typo in the ClusterClass name

Copy link
Member

@sbueringer sbueringer Feb 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question. Are we not surfacing all returned errors in the condition? Or do you mean with a special reason

(https://github.com/kubernetes-sigs/cluster-api/blob/main/internal/controllers/topology/cluster/conditions.go#L47-L59)

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 8, 2023
@killianmuldoon killianmuldoon force-pushed the pr-exvars-generation-check branch from e178cd7 to f26398b Compare February 8, 2023 09:42
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 8, 2023
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 8, 2023
@killianmuldoon killianmuldoon force-pushed the pr-exvars-generation-check branch from f26398b to d7f1009 Compare February 8, 2023 09:45
@sbueringer
Copy link
Member

/lgtm

/assign @fabriziopandini

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 8, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: f967b11824e9a25e0a054cb44ddde6a8741f938c

@sbueringer
Copy link
Member

Let's move on

/lgtm
/approve

@fabriziopandini I answered here: #8023 (comment)
As it's the same point as on other PRs. I think we're fine as the error is already surfaced in the condition. Let us know if we should follow-up in any way.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 8, 2023
@sbueringer
Copy link
Member

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 8, 2023
@k8s-ci-robot k8s-ci-robot merged commit 327aae2 into kubernetes-sigs:main Feb 8, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.4 milestone Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants