-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Not Ready] An attempt to update controller-runtime to v0.19 #11
base: main
Are you sure you want to change the base?
Conversation
handler.EnqueueRequestForOwner(scheme, testrestmapper.TestOnlyStaticRESTMapper(scheme), &corev1.ConfigMap{}), | ||
fsmhandler.TriggerTypeChild, | ||
) | ||
} | ||
|
||
t.Run(tc.name, func(t *testing.T) { | ||
queue := workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()) |
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.
The new Typed Default controller rate limiter has a delay of 5ms https://github.com/kubernetes/client-go/blob/e421aed7f1b4515185aecebbe101dcfa5fd52997/util/workqueue/default_rate_limiters.go#L50 which will cause the tests to fail unless we sleep for that time.
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 error results from the tests if we don't sleep? Trying to understand the exact mechanics
) | ||
} | ||
|
||
for _, watch := range b.watchesRawSource { |
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.
kubernetes-sigs/controller-runtime#2783 breaks this interface. They've moved the event handler and predicate arguments out of this method and into the underlying source structs.
Luckily there are only two extant usages of this builder method in achilles codebases (see here, reddit/achilles
and reddit/achilles-cassandra-controller
)
My proposal to fix this would be to:
- update the SDK builder's
WatchesRawSource
to match the controller-runtime interface (this is a break glass code interface) - add an SDK builder method
WatchesInformer
that takes asource.Informer
. The implementation then wraps thissource.Informer
with a newsource.Informer
that injects the observed event handler (used byreddit/achilles
) - same as 2 but
WatchesChannel
(used byreddit/achilles-cassandra-controller
)
Closes #
πΈ TL;DR
π Details
Design Doc
Jira
π§ͺ Testing Steps / Validation
β Checks