fix: reject --kube-api-qps without --kube-api-burst at startup - #466
fix: reject --kube-api-qps without --kube-api-burst at startup#466DsThakurRawat wants to merge 1 commit into
Conversation
✅ Deploy Preview for node-readiness-controller canceled.
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: DsThakurRawat The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @DsThakurRawat. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Both flags default to -1, which disables client-side throttling. A positive --kube-api-qps with the burst left at -1 is a configuration client-go refuses: the typed clientset fails to build and a controller-runtime client built from it fails every request with "rate: Wait(n=1) exceeds limiter's burst -1". The controller exited with a message that named neither flag, and the Helm chart renders that pair whenever only controller.kubeAPIQPS is set. Validate the pair right after flag parsing and fail with a message that names both flags. Signed-off-by: Divyansh Rawat <divyanshrawatofficial@gmail.com>
0fcd8e5 to
805187a
Compare
Description
cmd/main.gocopied--kube-api-qpsand--kube-api-burstinto the rest config as given. Both default to-1, which disables client-side throttling, but a positive QPS with the burst left at-1is a pair client-go refuses:kubernetes.NewForConfigfails with "burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0", and a controller-runtime client built from the same config fails every request with "rate: Wait(n=1) exceeds limiter's burst -1". The controller exited with the clientset message, which names neither flag, and the Helm chart renders that pair whenever onlycontroller.kubeAPIQPSis set.This validates the pair right after
flag.Parseand exits with a message that names both flags:The defaults and any pair with a positive burst are unchanged. A burst on its own is still accepted and ignored, as before.
Related Issue
Fixes #465
Type of Change
/kind bug
Testing
TestValidateKubeAPIFlagsincmd/main_test.gocovers the disabled defaults, both flags set, QPS with the default burst, QPS with a zero burst, burst on its own, and a zero QPS.--kube-api-qps=50alone exits 1 with the message above;--kube-api-qps=50 --kube-api-burst=100and the plain defaults start the manager as before.make testandmake lintpass locally.This PR was written in part with the assistance of generative AI; the failure was reproduced against the real binary and the change was reviewed and tested by hand.
Checklist
make testpassesmake lintpassesDoes this PR introduce a user-facing change?