Skip to content

feat: add AsReconciler wrapper to rate limit and replace controller-runtime's requeue: true behavior #160

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

rschalo
Copy link
Contributor

@rschalo rschalo commented Jun 8, 2025

Issue #, if available:

Description of changes:
In response to kubernetes-sigs/controller-runtime#3107, create a default rate limiter to add to singleton controllers that replicates the behavior of requeue: true

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@rschalo rschalo requested a review from a team as a code owner June 8, 2025 22:22
@rschalo rschalo changed the title feat: add default singleton rate limiter to replace requeue feat: add default singleton rate limiter to replace controller-runtime's requeue: true behavior Jun 8, 2025
@rschalo rschalo changed the title feat: add default singleton rate limiter to replace controller-runtime's requeue: true behavior feat: add AsReconciler wrapper to rate limit and replace controller-runtime's requeue: true behavior Jun 10, 2025
})
}

func TestAsGenericReconciler(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we adopt the same Ginkgo-based testing that we use elsewhere in this package?

type RequestKeyExtractor struct{}

// Extract returns the reconcile.Request as the key.
func (e RequestKeyExtractor) Extract(ctx context.Context, req reconcile.Request) reconcile.Request {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline - dropping in favor of two separate wrappers.

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

Successfully merging this pull request may close these issues.

2 participants