← Back to Pull requests

fix: reject --kube-api-qps without --kube-api-burst at startup #466

Closed
unknown closed this pull request without merging on Sep 15, 2026 18:25 UTC
View on GitHub
unknown unknown commented on Sep 13, 2026 02:34 UTC
Author

Description

cmd/main.go copied --kube-api-qps and --kube-api-burst into the rest config as given. Both default to -1, which disables client-side throttling, but a positive QPS with the burst left at -1 is a pair client-go refuses: kubernetes.NewForConfig fails 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 only controller.kubeAPIQPS is set.

This validates the pair right after flag.Parse and exits with a message that names both flags:

ERROR	setup	invalid flags	{"error": "--kube-api-burst must be greater than 0 when --kube-api-qps is set (got --kube-api-qps=50 --kube-api-burst=-1)"}

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

  • New TestValidateKubeAPIFlags in cmd/main_test.go covers the disabled defaults, both flags set, QPS with the default burst, QPS with a zero burst, burst on its own, and a zero QPS.

  • Built the binary from this branch and ran it against a fake API server: --kube-api-qps=50 alone exits 1 with the message above; --kube-api-qps=50 --kube-api-burst=100 and the plain defaults start the manager as before.

  • make test and make lint pass 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 test passes

  • make lint passes
  • Does this PR introduce a user-facing change?

    ``release-note
    The controller now exits at startup with a clear message when --kube-api-qps is set without a positive --kube-api-burst, instead of failing later with a client-go error that names neither flag.
    ``

    Diff: 259 lines (+194 / -65) across 3 files Reviewer: Karthik-K-N Review duration: 3831m
    All Vouch review confidence checks passed
    Residual risk 0.29 = Change Risk (0.62) × (1 − Review Confidence (0.54)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.62 · 259 lines diff across 3 files
    0.62
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    54%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.333
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.062
    Real PR Conversation Timeline
    1 comments
    "Review active on #466"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 54.2% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 62.4% (MEDIUM) · Higher = larger blast radius
    62.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 54.2% · Lower = rushed or shallow review
    54.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 28.5% · Safe to merge
    28.5%