FR-0053: add chao.excludedNamespaces - #150
Conversation
Passes -excluded_namespaces to the chao deployment. Inverse of chao.namespaces, for customers whose list of namespaces to skip is short and static while the list to include changes constantly. Defaults to [], so nothing changes unless it is set. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
chaoNamespacesValidate fails the render if chao.namespaces and chao.excludedNamespaces are both configured. Chao rejects the combination too, so failing here means the operator finds out at `helm install` rather than from a CrashLoopBackOff. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds single-entry rendering, ordering, flag exclusivity in both directions, empty-list-is-not-a-conflict, a second mutual-exclusion shape, and the chao.create=false case where the values are inert and nothing is validated. Mutation-checked: swapping the join separator fails 2 tests, removing the validation helper fails 2 tests. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Re-ran the minikube validation against the review changes and widened the helm unit tests. Cluster validation (56 namespaces, 50 created for the test with a canary Service each)
That last pair is the crash loop @gremsam called out, reproduced live and then shown fixed.
Helm unit tests
Mutation-checked rather than assumed: swapping the join separator fails 2 tests, removing the validation helper fails 2 tests. Full suite 147 passed, lint clean. Cluster left as found (test namespaces removed, existing |
There was a problem hiding this comment.
🟢 Approval recommended
The core change is small, well-validated with template guards and unit tests, with only minor documentation nits noted.
Pull request overview
Adds support for scoping Chao by excluding namespaces via a new chao.excludedNamespaces chart value, rendering a corresponding -excluded_namespaces container arg and preventing ambiguous configuration when combined with the existing chao.namespaces allowlist.
Changes:
- Introduces
chao.excludedNamespaces(default[]) and renders-excluded_namespaceswhen non-empty. - Adds a Helm template validation that fails install when both
chao.namespacesandchao.excludedNamespacesare set (whenchao.createrenders the deployment). - Adds helm-unittest coverage for default behavior, rendering behavior, and mutual exclusivity; bumps chart version to
0.28.0.
File summaries
| File | Description |
|---|---|
| gremlin/values.yaml | Documents and adds the new chao.excludedNamespaces value. |
| gremlin/templates/chao-deployment.yaml | Renders -excluded_namespaces args and invokes namespace validation. |
| gremlin/templates/_helpers.tpl | Adds chaoNamespacesValidate mutual exclusivity guard. |
| gremlin/tests/chao_deployment_namespaces_test.yaml | Adds unit tests covering default rendering, formatting, and validation failures. |
| gremlin/README.md | Documents the new chart value in the configuration table. |
| gremlin/Chart.yaml | Bumps chart version 0.27.0 → 0.28.0. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| | `chao.namespaces` | List of namespaces for Gremlin to watch for attacking | `[]` | ||
| | `chao.excludedNamespaces` | List of namespaces Gremlin should never report or attack (mutually exclusive with `chao.namespaces`) | `[]` | |
| # chao.excludedNamespaces | ||
| # list of namespaces Gremlin should never report or attack. Use this instead of chao.namespaces | ||
| # when the set of namespaces to skip is short and stable but the set to include changes often. | ||
| # Mutually exclusive with chao.namespaces: setting both fails the install. |
What
Adds
chao.excludedNamespaces, which passes-excluded_namespacesto the chao deployment. Inverse ofchao.namespaces, for customers whose list of namespaces to skip is short and static while the list to include changes constantly.Defaults to
[], so nothing changes unless it is set. Chart0.27.0→0.28.0.Testing
gremlin/tests/chao_deployment_namespaces_test.yaml, 3 cases: no flags by default, exclusion rendered as a comma-separated list, and both flags together. Full suitehelm unittest gremlin: 140 passed,helm lintclean.Validated end-to-end against minikube with 57 namespaces (50 created for the test, each with a canary Service), 2 permitted (
gremlin,fr53-07), 55 excluded. Built a chao image from the dependency PR, loaded it into minikube, installed from this chart, and recorded every payload the live pod pushed to a stand-in control plane:gremlin,fr53-07The live pod's args carry
-excluded_namespaceswith all 55.Dependency
Blocked on gremlin/chao#347 — the flag does not exist until that ships. Setting
chao.excludedNamespacesagainst a chao image without it will crashloop onflag provided but not defined. Default installs are unaffected because the arg is only rendered when the value is non-empty.Chart pins
chaoimage.tag: latest, so no image bump is needed here, but do not release this chart before chao#347 is released.