fix(bundler): scope helmfile disableValidation to primary release#1125
Conversation
The HasSelfRefCRDs flag was applied to every release in a folder group, including the local-helm `-pre` and `-post` wrapper releases. Wrappers hold only raw Kubernetes manifests with no `crds/` directory and no self-references, so inheriting `disableValidation: true` silently suppressed helm-diff's mapper sanity check on resources where it is still valuable. Gate the flag on `f.Name == f.Parent` so only the primary release (matching folder name and parent component) gets `disableValidation`. Regenerated the mixed_gpu_operator golden to drop the spurious flag on the post wrapper. Added TestBuildHelmfile_DisableValidationPrimaryOnly to cover the pre/primary/post split.
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThis PR implements scoped application of the Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Coverage Report ✅
Coverage BadgeNo Go source files changed in this PR. |
Summary
Scope helmfile
disableValidation: trueto the primary release in a folder group; do not propagate it to the local-helm-pre/-postwrappers.Motivation / Context
The
HasSelfRefCRDsregistry flag (added in #914 for charts whose templates reference CRDs the chart itself installs) was being applied to every release sharing a parent component. The wrappers are local-helm raw-manifest charts with nocrds/directory and no self-references, so inheriting the flag silently suppressed helm-diff's mapper sanity check on resources where it is still valuable.Fixes: #929
Related: #914
Type of Change
Component(s) Affected
pkg/bundler,pkg/component/*)Implementation Notes
pkg/bundler/deployer/helmfile/releases.go, the gate is nowif f.Name == f.Parent && flags[f.Parent].HasSelfRefCRDs— thef.Name == f.Parentpredicate is the canonical "is this the primary release for this component" check in the localformat folder model. Wrappers append-pre/-posttoNamewhile keepingParentas the component name.DisableValidationfield onReleasewas updated to record the scoping and reference both issues.Testing
go test ./pkg/bundler/deployer/helmfile/ golangci-lint run -c .golangci.yaml ./pkg/bundler/deployer/helmfile/...TestBuildHelmfile_DisableValidationPrimaryOnlywith a pre + primary (KindUpstreamHelm) + post layout. AssertsDisableValidationisfalseon the wrappers andtrueonly on the primary.mixed_gpu_operatorgolden viago test ./pkg/bundler/deployer/helmfile/ -run TestGenerate_Scenarios -update. Diff: one line removed (disableValidation: trueongpu-operator-post).Risk Assessment
Rollout notes: Behavioral change is limited to bundles whose primary component has
HasSelfRefCRDs: trueAND ships wrappers — today this is gpu-operator only. Operators previously sawdisableValidation: trueon the post wrapper for gpu-operator; the new output removes it, restoring the mapper check on the wrapper's plain manifests. No registry / values / docs change.Checklist
make testwith-race)make lint)git commit -S)