-
Notifications
You must be signed in to change notification settings - Fork 3.4k
endpointstate: Add an interface to wait for endpoint restore #29243
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
endpointstate: Add an interface to wait for endpoint restore #29243
Conversation
/test |
@pippolo84 can you add a codeowner for endpointstate please? |
f854d91
to
8008794
Compare
Done. I've assigned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. A few comments on the commit description:
- There's a typo (
to requires
) - It would be nice to mention the use case that motivates the change (you mention it in the PR description, not in the commit log)
Not blocking, though.
Provide an API to let callers wait for the endpoint restoration to be completed. To avoid import cycles, the interface wrapping the API is defined outside of the daemon/cmd package where it is implemented. This allows cells to require an endpointstate.Restorer through Hive dependency injection without pulling in the daemon/cmd package. This is a required step to migrate the k8s CEP watchers to Resource[T]. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
8008794
to
818a7be
Compare
Thanks for the pointers, I've fixed the commit message. 👍 |
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excellent work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see the new interface being used yet in this PR, but this is likely as planned.
Yep, it'll be used in the modularized endpoint GC: #29246 |
Provide an API to let callers wait for the endpoint restoration to be completed. To avoid import cycles, the interface wrapping the API is defined outside of the
daemon/cmd
package where it is implemented. This allows cells to require anendpointstate.Restorer
through Hive dependency injection without pulling in thedaemon/cmd
package.This is a required step to migrate the k8s CEP watchers to Resource[T]. Refer to this comment for more information.
Related: #28159