Skip to content

✨ Leverage isInInitialList of ResourceEventHandler.OnAdd, Add IsInInitialList to TypedCreateEvent #3162

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

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Mar 16, 2025

Signed-off-by: Stefan Büringer [email protected]

Let's start using IsInitialList that is provided in the OnAdd func of ResourceEventHandlers.

This can be leveraged to determine in a clean way if an add/create event came from an initial list.

https://kubernetes.slack.com/archives/C02MRBMN00Z/p1742119089612549?thread_ts=1741482643.357719&cid=C02MRBMN00Z

Reverts the parts of #2223 that we don't need anymore.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 16, 2025
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 16, 2025
@sbueringer sbueringer force-pushed the pr-initial-list branch 2 times, most recently from c423650 to 8b4eacb Compare March 16, 2025 10:16
@sbueringer
Copy link
Member Author

cc @howardjohn (as this is basically a follow-up to #2223)

@sbueringer
Copy link
Member Author

/assign @alvaroaleman @vincepri

@sbueringer sbueringer changed the title [WIP] ✨ Leverage Informer OnAdd IsInInitialList ✨ Leverage Informer OnAdd IsInInitialList Mar 16, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 16, 2025
@sbueringer sbueringer changed the title ✨ Leverage Informer OnAdd IsInInitialList ✨ Use EventHandler with isInInitialList, Add IsInInitialList to TypedCreateEvent Mar 16, 2025
@sbueringer sbueringer changed the title ✨ Use EventHandler with isInInitialList, Add IsInInitialList to TypedCreateEvent ✨ Leverage isInInitialList of ResourceEventHandler.OnAdd, Add IsInInitialList to TypedCreateEvent Mar 16, 2025
Copy link
Member

@alvaroaleman alvaroaleman left a comment

Choose a reason for hiding this comment

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

Nice, that is a great simplification

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

LGTM label has been added.

Git tree hash: 7e93121436ab7aaecc13f3a2a185bfe6f1cc5b62

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, 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:
  • OWNERS [alvaroaleman,sbueringer]

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

@sbueringer
Copy link
Member Author

/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 Mar 17, 2025
@sbueringer
Copy link
Member Author

Thx again @caozhuozi for bringing this one up! :)

@k8s-ci-robot k8s-ci-robot merged commit fa1d0ee into kubernetes-sigs:main Mar 17, 2025
25 checks passed
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/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