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
There are two clock packages with divergent history #94738
Comments
@kubernetes/sig-api-machinery-bugs |
Whoops! Thanks for noticing! Tagging recent other editors: @munnerz @euank @kevindelgado Which one should we keep? |
I think the one in k8s.io/utils is necessary, because it is consumed by component-base, on which apimachinery depends. I created kubernetes/utils#190 to start fixing the clock package in utils. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/lifecycle frozen |
/assign |
@MikeSpreitzer - once #105372 and #105375 are merged in, the codebase will be fully migrated away from How can we proceed with removal of this package? Is there some policy around this? |
There seem to be a lot of out-of-tree uses of it (https://grep.app/search?q=%22k8s.io/apimachinery/pkg/util/clock%22&filter[lang][0]=Go) ... if it's easy to use type aliases to map to matching k8s.io/utils interfaces/implementations and mark the If that doesn't work or makes the package unmaintainable in some way, removing with a docs pointer seems ok. |
Hey @liggitt 👋🏼 // k8s.io/utils/clock
package clock
...
type WithTickerAndDelayedExecution interface {
WithTicker
AfterFunc(d time.Duration, f func()) Timer
} And in // k8s.io/apimachinery/pkg/util/clock
package clock
clockUtils import "k8s.io/utils/clock"
type PassiveClock = clockUtils.PassiveClock
type Clock = clockUtils.WithTickerAndDelayedExecution
type RealClock = clockUtils.RealClock
// so on for fake clocks as well. Does this sound OK? |
Friendly ping @liggitt ^ :) |
I don't have strong opinions about the transition in k8s.io/apimachinery... using a matching library version there is expected I'll defer to @wojtek-t on the plan for the utils interface... defining a new interface is the only real way I see to stay backward compatible with the existing exposed go API there. To avoid repeating issues of the past, settle on the final/full interface you need to collapse onto before merging to utils |
@wojtek-t how does this sound to you wrt unblocking the migration? |
This sounds good to me. |
Thanks @wojtek-t! |
Commented there |
Hooray! Thanks, @MadhavJivrajani ! |
What happened:
I discovered a need to update one of the two clock packages, and preparation for that revealed the divergent history of the two.
One line of development can be seen in
It looks like early on that was cloned into k8s.io/utils, and from there we have an independent line of development:
What you expected to happen:
The two clock packages would be kept in sync for a while and then one removed.
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Environment:
kubectl version
):cat /etc/os-release
):uname -a
):The text was updated successfully, but these errors were encountered: