-
Notifications
You must be signed in to change notification settings - Fork 92
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
runtime: Use server-side throttling when available #270
Conversation
// GetConfigOrDie wraps ctrl.GetConfigOrDie and checks if the Kubernetes apiserver | ||
// has PriorityAndFairness flow control filter enabled. If true, it returns a rest.Config | ||
// with client side throttling disabled. Otherwise, it returns a modified rest.Config | ||
// configured with the provided Options. | ||
func GetConfigOrDie(opts Options) *rest.Config { |
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.
While working on fluxcd/helm-controller#480, I discovered this func does not have a non-panicing counterpart.
I think this would be useful to have in situations where you work with the option, but not the configuration (like the above PR).
@aryan9600 please test this code with the Flux RBAC and see if we need to allow any new endpoints. Looking at the flowcontrol code seems that access to the |
I don't think that's the case, since only the |
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
Thanks @aryan9600
@aryan9600 please rebase |
Checks if the PriorityAndFairness flow control filter is enabled to disable client side throttling, leveraging server side throttling instead, since client-go respects the `Retry-After` response header set by the APF filter Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
cedb123
to
5909ab5
Compare
Checks if the PriorityAndFairness flow control filter is enabled to
disable client side throttling, leveraging server side throttling
instead, since client-go respects the
Retry-After
response header setby the APF filter.
Fixes: #269
Signed-off-by: Sanskar Jaiswal jaiswalsanskar078@gmail.com