Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shadialtarsha
Copy link

Closes #

πŸ’Έ TL;DR

πŸ“œ Details

Design Doc

Jira

πŸ§ͺ Testing Steps / Validation

βœ… Checks

  • CI tests (if present) are passing
  • Adheres to code style for repo
  • Contributor License Agreement (CLA) completed if not a Reddit employee

handler.EnqueueRequestForOwner(scheme, testrestmapper.TestOnlyStaticRESTMapper(scheme), &corev1.ConfigMap{}),
fsmhandler.TriggerTypeChild,
)
}

t.Run(tc.name, func(t *testing.T) {
queue := workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter())
Copy link
Author

@shadialtarsha shadialtarsha Jan 13, 2025

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.

Copy link
Collaborator

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 {
Copy link
Collaborator

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:

  1. update the SDK builder's WatchesRawSource to match the controller-runtime interface (this is a break glass code interface)
  2. add an SDK builder method WatchesInformer that takes a source.Informer. The implementation then wraps this source.Informer with a new source.Informer that injects the observed event handler (used by reddit/achilles)
  3. same as 2 but WatchesChannel (used by reddit/achilles-cassandra-controller)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants