-
Notifications
You must be signed in to change notification settings - Fork 203
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
Prepare clock package to be compatible replacement of apimachinery/util/clock #224
Prepare clock package to be compatible replacement of apimachinery/util/clock #224
Conversation
this has the same problem with making incompatible changes to existing interfaces as #221 (comment) |
The API diff will fail here. Do we introduce a new interface to further encapsulate things? |
Yep :) |
Hey @liggitt - any updates on this? |
once an interface is merged, available, and picked up as a dependency in other places, we should not break the interface https://grep.app/search?q=WithDelayedExecution shows the existing interface has already been picked up by some repos other than kubernetes/kubernetes |
Ah I see - thanks for pointing towards that, I'll revert the change and introduce another interface. |
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
280f528
to
ba42345
Compare
xposting: kubernetes/kubernetes#94738 (comment) |
Eventhough the implementation is just a panic, re-implementing the `NewTicker` method helps in migration of the apimachinery/util/clock pkg to the utils/clock pkg in terms of having identical clients for `IntervalClock` in both packages as well as the `IntervalClock` implementing the `WithTickerAndDelayedExcution` interface. Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
/hold |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dims, MadhavJivrajani, wojtek-t 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 |
can you open a WIP PR against kubernetes/kubernetes that bumps k8s.io/utils to this commit and ensures we can completely switch over to this package and get green CI on that PR? you can do that in kubernetes/kubernetes like this:
|
That LGTM |
Thank you, both! |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Commit 1:
The reason for doing this is that
utils/clock
is supposedto be a full replacement for
k8s.io/apimachinery/pkg/util/clock
.Currently,
WithDelayedExecution
extends Clock - in order to deprecateapimachinery/clock,
WithDelayedExecution
would be missing the NewTickermethod if gradual deprecation via type aliasing was to be done.
By extending
WithTicker
instead ofClock
, we solve this issue.Commit 2:
Eventhough the implementation is just a panic,
re-implementing the
NewTicker
method helpsin migration of the apimachinery/util/clock pkg
to the utils/clock pkg in terms of having identical
clients for
IntervalClock
in both packages aswell as the
IntervalClock
implementing theWithTickerAndDelayedExcution
interface.Which issue(s) this PR fixes:
Related to kubernetes/kubernetes#94738
Special notes for your reviewer:
The next step after this would be to implement the
Tick
method in apimachinery clock, type aliasing the interfaces and marking the package as deprecated.Release note:
/assign @liggitt @dims
/cc @wojtek-t