Add helm-unittest suite for operator-crds toggles#5468
Open
ChrisJBurns wants to merge 2 commits into
Open
Conversation
The operator-crds chart wraps every CRD in two values gates: crds.install (gates the whole render) and crds.keep (gates the helm.sh/resource-policy: keep annotation). A regression in either is silent — `helm install` still succeeds with the install gate removed, and a dropped keep annotation silently cascade-deletes CRs on uninstall. `ct install` cannot catch these. Add a helm-unittest suite covering all 13 CRDs that asserts the default render, crds.install=false, and crds.keep=false behaviours, plus a `task helm-unittest` runner and a CI step. Following the pattern established in stacklok-llm-gateway. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The suite will grow beyond the operator-crds toggles, so replace the toggle-specific comment with a generic note on what helm-unittest is and why we run it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5468 +/- ##
==========================================
- Coverage 69.23% 69.21% -0.03%
==========================================
Files 636 636
Lines 64724 64724
==========================================
- Hits 44810 44797 -13
- Misses 16605 16617 +12
- Partials 3309 3310 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rdimitrov
approved these changes
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
operator-crdschart wraps every CRD in two values gates —crds.install(gates the whole render) andcrds.keep(gates thehelm.sh/resource-policy: keepannotation). A regression in either is silent:helm installstill succeeds when the install gate is removed, and a dropped keep annotation silently cascade-deletes CustomResources on uninstall.ct installcannot catch these failure modes. This adds a helm-unittest suite to make both behaviours red-on-break, following the pattern established instacklok-llm-gateway.Medium level
deploy/charts/operator-crds/tests/toggles_test.yaml— three tests (default render,crds.install=false,crds.keep=false) asserted per template across all 13 CRDs.helm-unittesttask to theTaskfilethat installs the plugin (pinnedv1.0.3) if missing and runs the suite.Run helm-unitteststep to thehelm-charts-testworkflow betweenct lintand the KIND install, invokingtask helm-unittest.tests/from the packaged chart via.helmignore.Low level
deploy/charts/operator-crds/tests/toggles_test.yamlTaskfile.ymlhelm-unittesttask; pins plugin versionv1.0.3.github/workflows/helm-charts-test.ymltask helm-unittestafter lintdeploy/charts/operator-crds/.helmignoretests/from packaged chartType of change
Test plan
task helm-unittestpasses (3 tests × 13 CRDs)keepannotation unconditional in one CRD fails thecrds.keep=falsetest; restoring the template returns it to greenSpecial notes for reviewers
operator-crdsonly, matching the example repo. Theoperatorchart's templates don't have these toggles; adding a suite there would be separate follow-up work.Generated with Claude Code