-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Move client-go/tools/record tests away from IntervalClock
to SimpleIntervalClock
#104578
Move client-go/tools/record tests away from IntervalClock
to SimpleIntervalClock
#104578
Conversation
/sig api-machinery |
/assign @MikeSpreitzer |
/test pull-kubernetes-integration |
/test pull-kubernetes-e2e-gce-ubuntu-containerd |
This is a good start. We should be able to refactor further, so that a |
@MikeSpreitzer, in order to move from |
IntervalClock
to SimpleIntervalClock
/triage accepted |
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.
Oops, sorry, I had not noticed the Wait method of RateLimiter. That also has to be excised from PassiveRateLimiter.
806a4a6
to
05b96de
Compare
05b96de
to
a29baac
Compare
/test pull-kubernetes-unit |
1 similar comment
/test pull-kubernetes-unit |
a29baac
to
b47de20
Compare
b47de20
to
34f9895
Compare
/hold |
34f9895
to
cd40d92
Compare
- Introduce PassiveRateLimiter which implements all methods of previous RateLimiter except Accept() and Wait() - Change RateLimiter interface to extend PassiveRateLimiter by additionally implementing Accept() and Wait() - Make client-go/tools/record use PassiveRateLimiter Refactor EventSourceObjectSpamFilter, EventAggregator, EventCorrelator - EventSourceObjectSpamFilter, EventAggregator, EventCorrelator use clock.PassiveClock now. - This won't be a breaking change because even if a clock.Clock is passed, it still implements the clock.PassiveClock interface. - Extend clock.PassiveClock through Clock. - Replace pacakge local implementation of realClock with clock.RealClock - In flowcontrol/throttle.go split tokenBucketRateLimiters to use Clock and clock.PassiveClock. - Migrate client-go/tools/record tests from using IntervalClock to using SimpleIntervalClock (honest implementation of clock.PassiveClock) Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
cd40d92
to
ac5c55f
Compare
/test all |
/hold cancel |
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.
/lgtm
/assign @liggitt |
) | ||
|
||
type RateLimiter interface { | ||
type PassiveRateLimiter interface { |
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.
what's the difference between PassiveRateLimiter and RateLimiter? it's not clear why TryAccept belongs in once interface and Accept belongs in the other
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.
PassiveRateLimiter reads time but does do any waiting.
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, MadhavJivrajani, MikeSpreitzer 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 |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Refactor EventSourceObjectSpamFilter, EventAggregator, EventCorrelator
Which issue(s) this PR fixes:
Fixes #104500
Special notes for your reviewer:
None
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/priority backlog