Port rate limiter to experimental charts#4478
Conversation
|
Hello! Thank you for your contribution. Please review our contribution guidelines to understand the project's testing and code conventions. |
There was a problem hiding this comment.
Pull request overview
Ports the controller’s new --workqueue-rate-limiter configuration into the experimental Helm chart so operators can select between the default bucket limiter and the per-item typed limiter.
Changes:
- Documented a new
controller.manager.config.rateLimiter.namevalue in the experimental chart’svalues.yaml. - Rendered
--workqueue-rate-limiter=<name>into the controller Deployment args when configured. - Replaced the removed Go template test with a helm-unittest suite covering the new flag rendering behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| charts/gha-runner-scale-set-controller-experimental/values.yaml | Adds documented values for configuring the workqueue rate limiter. |
| charts/gha-runner-scale-set-controller-experimental/templates/_controller_template.tpl | Renders --workqueue-rate-limiter when controller.manager.config.rateLimiter.name is set. |
| charts/gha-runner-scale-set-controller-experimental/tests/template_test.go | Removes Go-based chart rendering test from the experimental chart. |
| charts/gha-runner-scale-set-controller-experimental/tests/controller_deployment_rate_limiter_test.yaml | Adds helm-unittest coverage for default omission + explicit rate limiter arg rendering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| content: "--workqueue-rate-limiter=bucket_rate_limiter" | ||
| - notContains: | ||
| path: spec.template.spec.containers[0].args | ||
| content: "--workqueue-rate-limiter=typed_rate_limiter" |
There was a problem hiding this comment.
The default-case test only asserts the args list does not contain the two specific values. This would still pass if the chart accidentally rendered something like --workqueue-rate-limiter= (or a future third value). To actually verify the flag is omitted by default, assert that no arg contains the --workqueue-rate-limiter= prefix (e.g., via a single notContains on the prefix or a regex-based assertion, depending on helm-unittest capabilities).
| content: "--workqueue-rate-limiter=bucket_rate_limiter" | |
| - notContains: | |
| path: spec.template.spec.containers[0].args | |
| content: "--workqueue-rate-limiter=typed_rate_limiter" | |
| content: "--workqueue-rate-limiter=" |
| - it: should render both config and extraArgs in deterministic order | ||
| set: | ||
| controller: | ||
| manager: | ||
| config: | ||
| rateLimiter: | ||
| name: "bucket_rate_limiter" | ||
| container: | ||
| extraArgs: | ||
| - "--workqueue-rate-limiter=typed_rate_limiter" | ||
| release: | ||
| name: "test-arc" | ||
| namespace: "test-ns" | ||
| asserts: | ||
| - contains: | ||
| path: spec.template.spec.containers[0].args | ||
| content: "--workqueue-rate-limiter=bucket_rate_limiter" | ||
| - contains: | ||
| path: spec.template.spec.containers[0].args | ||
| content: "--workqueue-rate-limiter=typed_rate_limiter" |
There was a problem hiding this comment.
This test claims to verify deterministic ordering between the config-generated flag and extraArgs, but it only checks that both values are present. Since duplicate flags are order-sensitive (the last one typically wins), this test should assert the relative order in the rendered args list (or rename the test to avoid implying ordering is verified).
94f98df to
8958d25
Compare
Port rate limiter in experimental chart on top of #4451