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 typed watcher to ClusterCache #11331

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

ykakarap
Copy link
Contributor

What this PR does / why we need it:

This PR adds support for typed watched to ClusterCache.

This will be specially useful when you want to reconcile a single object on the workload cluster.

With the current API to reconcile a single object on the workload cluster we need to reconcile an object on the mgt cluster that inturn reconciles all objects on the workload cluster.

An example use case when the new API would be useful:
Reconciling a single workload cluster node instead of queueing the CAPI Cluster to then reconciler all workload cluster nodes.

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 #

/area clustercachetracker

@k8s-ci-robot k8s-ci-robot added area/clustercache Issues or PRs related to the clustercachetracker cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 23, 2024
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 23, 2024
@ykakarap
Copy link
Contributor Author

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Oct 23, 2024
@ykakarap
Copy link
Contributor Author

/cc sbueringer

@ykakarap
Copy link
Contributor Author

/cc vincepri

@k8s-ci-robot k8s-ci-robot requested a review from vincepri October 23, 2024 22:49
@sbueringer
Copy link
Member

I need some time to take a look, but I think I have an idea how we could make this a (non-generic) method

@ykakarap ykakarap force-pushed the clustercache-typedwatch branch from d6f3c78 to 6db51a2 Compare October 29, 2024 00:20
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 29, 2024
@ykakarap ykakarap changed the title ✨ add TypedWatch to ClusterCache ✨ add typed watcher to ClusterCache Oct 29, 2024
@sbueringer
Copy link
Member

/test pull-cluster-api-e2e-main

@ykakarap
Copy link
Contributor Author

I need some time to take a look, but I think I have an idea how we could make this a (non-generic) method

The new commits take care of this. Now the PR just extend ClusterCache Watch function to also support generics. The impact to existing invocation of Watch is pretty minimal and is already addressed in this PR. Since this package is not yet released the api diff should also not be a problem.

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/lgtm
/assign @sbueringer

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

LGTM label has been added.

Git tree hash: 01a0f045ce6e30df9a6f9ef612b30adef1d7fde5

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.

I like the direction. A few ideas to improve further

@ykakarap ykakarap force-pushed the clustercache-typedwatch branch from 6db51a2 to 2e789e5 Compare November 2, 2024 00:00
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 2, 2024
@ykakarap
Copy link
Contributor Author

ykakarap commented Nov 2, 2024

/test pull-cluster-api-e2e-main

@ykakarap ykakarap force-pushed the clustercache-typedwatch branch from 2e789e5 to 2e6a3a2 Compare November 6, 2024 17:01
@ykakarap
Copy link
Contributor Author

ykakarap commented Nov 6, 2024

@sbueringer Addressed all review comments.

@ykakarap
Copy link
Contributor Author

ykakarap commented Nov 6, 2024

/test pull-cluster-api-e2e-main

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.

Last round of nits from my side

@ykakarap ykakarap force-pushed the clustercache-typedwatch branch from 2e6a3a2 to 1c26e63 Compare November 11, 2024 17:33
@k8s-ci-robot
Copy link
Contributor

@ykakarap: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-apidiff-main 1c26e63 link false /test pull-cluster-api-apidiff-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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-sigs/prow repository. I understand the commands that are listed here.

@sbueringer
Copy link
Member

Thank you! Very nice improvement

/lgtm
/approve

/hold
In case you want further reviews, feel free to merge

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Nov 11, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: f1c105dcf69b9452fc3132e0866255a3af1d4507

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 11, 2024
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

Fantastic work!

/approve
/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 Nov 11, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer, vincepri

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:
  • OWNERS [sbueringer,vincepri]

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 merged commit f495466 into kubernetes-sigs:main Nov 11, 2024
18 of 19 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.9 milestone Nov 11, 2024
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/clustercache Issues or PRs related to the clustercachetracker 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants