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

🌱 Watch for Cluster resources in topology MD controller #9865

Merged

Conversation

adityabhatia
Copy link
Contributor

@adityabhatia adityabhatia commented Dec 12, 2023

What this PR does / why we need it:
This PR adds a Watch on Cluster Resources in the topology based MachineDeployment controller, thereby triggering reconciliation on Cluster resource / status update.

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 # #9532

/area testing

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area PR is missing an area label needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 12, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @adityabhatia. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@adityabhatia adityabhatia changed the title 🌱 [WIP] Watch for Cluster resources in topology MD controller 🌱 Watch for Cluster resources in topology MD controller Dec 12, 2023
@sbueringer
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 13, 2023
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 cleanup!

@adityabhatia adityabhatia force-pushed the clusterWatcherInMdCtrl branch 2 times, most recently from 24484c8 to 814ed35 Compare December 13, 2023 09:35
@adityabhatia adityabhatia force-pushed the clusterWatcherInMdCtrl branch 2 times, most recently from 32ccef1 to e668a38 Compare December 13, 2023 10:10
@adityabhatia
Copy link
Contributor Author

/test pull-cluster-api-e2e-full-main

Named("topology/machinedeployment").
WithEventFilter(predicates.ResourceHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I separated the combined filter ResourceNotPausedAndHasFilterLabel, since IMO it is easier to read and we do not have any other Watched resources in this controller

// TODO: should this wait for Cluster.Status.InfrastructureReady similar to Infra Machine resources?
predicates.All(ctrl.LoggerFrom(ctx),
predicates.ClusterUnpaused(ctrl.LoggerFrom(ctx)),
predicates.ResourceHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this could be taken over by the global predicate

@adityabhatia
Copy link
Contributor Author

/area testing

@k8s-ci-robot k8s-ci-robot added area/testing Issues or PRs related to testing and removed do-not-merge/needs-area PR is missing an area label labels Dec 13, 2023
@adityabhatia
Copy link
Contributor Author

/retest

@adityabhatia
Copy link
Contributor Author

/test pull-cluster-api-e2e-full-main

@adityabhatia
Copy link
Contributor Author

@sbueringer could you PTAL again?

@sbueringer
Copy link
Member

Will take a look soon

@sbueringer
Copy link
Member

Thank you!

/lgtm
/approve

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

LGTM label has been added.

Git tree hash: ada2b519327823d0a7d19436285bfbe7cf186eb1

@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 Jan 10, 2024
@k8s-ci-robot k8s-ci-robot merged commit 9f124ad into kubernetes-sigs:main Jan 10, 2024
26 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.7 milestone Jan 10, 2024
@chrischdi
Copy link
Member

Could it be that this caused some current e2e flakes/issues? https://testgrid.k8s.io/sig-cluster-lifecycle-cluster-api#capi-e2e-main

@sbueringer
Copy link
Member

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. area/testing Issues or PRs related to testing 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

None yet

4 participants