Repository navigation
fix(bundler): emit disableValidation on CRD-dependent -post wrappers - #1687
Conversation
Recipe evidence check
Other affected recipes without evidence yet: 22These recipes are affected by this PR but carry no committed evidence pointer, so there is
This gate is warning-only and never blocks merge. See ADR-007 for the trust model. |
Coverage Report ✅
Coverage BadgeMerging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. |
yuanchen8911
left a comment
There was a problem hiding this comment.
Two gaps in the flag's coverage, detailed inline: the --vendor-charts layout collapses post manifests into the primary wrapper so the -post release-name condition never fires, and kubeflow-trainer has the same post-manifest/parent-CRD shape via platform-kubeflow but doesn't get the flag. The mechanism and scoping of the change itself look right (the -post-only emission, #929 preservation on primaries and -pre wrappers, and the test).
📝 WalkthroughWalkthroughAdds a new Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Injected -post wrapper releases carry manifestFiles that instantiate CRs of CRDs the parent chart installs, but the wrapper shares the parent's sub-helmfile level and helmfile diffs every release in a level before applying any — so on a fresh cluster the wrapper's helm-diff REST-mapper check can never pass (network-operator's NicClusterPolicy on AKS, kubeflow-trainer's ClusterTrainingRuntime via platform-kubeflow). Add registry flag manifestsUseChartCRDs (sibling of hasSelfRefCRDs, issue #914) that emits disableValidation: true on the release whose folder carries the post-phase manifests. The decision is keyed off a new localformat Folder.CarriesPostManifests marker — set by both the -post injection writer and the collapsed vendored mixed wrapper — so the fix also covers --vendor-charts bundles, where mixed components never split and a release-name-suffix check would be a silent no-op. Primaries without post manifests and -pre wrappers keep the mapper sanity check per issue #929. Set the flag on network-operator and kubeflow-trainer. Fixes: #1666 Signed-off-by: Mark Chmarny <[email protected]>
fbda78f to
49f5da5
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 97625e1f-15aa-41f2-a047-95fe08aa4332
📒 Files selected for processing (12)
docs/contributor/component.mddocs/contributor/recipe.mdpkg/bundler/deployer/helmfile/helmfile.gopkg/bundler/deployer/helmfile/helmfile_test.gopkg/bundler/deployer/helmfile/releases.gopkg/bundler/deployer/localformat/folder.gopkg/bundler/deployer/localformat/vendor_folder.gopkg/bundler/deployer/localformat/vendor_write_test.gopkg/bundler/deployer/localformat/writer.gopkg/bundler/deployer/localformat/writer_test.gopkg/recipe/components.gorecipes/registry.yaml
| // Mixed components collapse into this single folder under | ||
| // VendorCharts, so the post-phase manifests live in its | ||
| // templates/ as post-install hooks (see writeMixedManifests | ||
| // above) — the marker travels with them. | ||
| CarriesPostManifests: len(manifests) > 0, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔵 Trivial | 💤 Low value
Marker uses pre-render manifest count, not actual written templates.
CarriesPostManifests: len(manifests) > 0 is set from the raw manifest map before writeMixedManifests filters out entries that render to empty YAML (skipped at lines 279-283 of writeMixedManifests). If every manifest for a component renders empty, the folder is marked CarriesPostManifests: true even though templateRelPaths (and thus the folder's actual templates/) is empty — contradicting the field's own doc ("this folder's chart contains the component's post-phase raw manifests"). Effect is only an unnecessary disableValidation: true downstream, not a missed safety check, so this is a low-severity inconsistency.
Consider deriving the marker from templateRelPaths (computed at line 143) instead of the raw manifests map, to keep the marker's semantics aligned with what's actually written.
♻️ Proposed fix
templateRelPaths, err := writeMixedManifests(ctx, folderDir, dir, c, manifests)
if err != nil {
return Folder{}, VendorRecord{}, err
}
@@
CreateNamespace: true,
// Mixed components collapse into this single folder under
// VendorCharts, so the post-phase manifests live in its
// templates/ as post-install hooks (see writeMixedManifests
// above) — the marker travels with them.
- CarriesPostManifests: len(manifests) > 0,
+ CarriesPostManifests: len(templateRelPaths) > 0,📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Mixed components collapse into this single folder under | |
| // VendorCharts, so the post-phase manifests live in its | |
| // templates/ as post-install hooks (see writeMixedManifests | |
| // above) — the marker travels with them. | |
| CarriesPostManifests: len(manifests) > 0, | |
| // Mixed components collapse into this single folder under | |
| // VendorCharts, so the post-phase manifests live in its | |
| // templates/ as post-install hooks (see writeMixedManifests | |
| // above) — the marker travels with them. | |
| CarriesPostManifests: len(templateRelPaths) > 0, |
Kueue was registered in the component registry but referenced by zero overlays and shipped no queue or quota CRs, so a deployed Kueue admitted nothing out of the box. - Add registry-level manifestFiles defaults to ComponentConfig: a component can now ship default manifests wherever a recipe references it; ref-declared (overlay/mixin) lists take precedence. No opt-out: an empty ref-declared list is indistinguishable from absent — declare a replacement list to suppress the defaults. - Fail closed at registry load when a Kustomize-typed component declares manifestFiles: validateComponentRef rejects the combination per-ref, so a registry-level mistake would otherwise surface at resolution time in every consumer at once. - Mark kueue manifestsUseChartCRDs: the quota CRs instantiate CRDs the chart itself installs, so the injected kueue-post wrapper needs the helm-diff REST-mapper bypass (NVIDIA#914/NVIDIA#929 pattern, added in NVIDIA#1687). - Bump kueue chart 0.17.1 -> 0.18.2 and ship default quota CRs (ResourceFlavor with GPU-taint toleration, ClusterQueue with admission-neutral quotas, LocalQueue default/default) as post-install hooks ordered by dependency. - Pin managerConfig to the chart 0.18.2 default with integrations.frameworks trimmed to batch/job, JobSet, TrainJob - drops the default-on pod/deployment/statefulset webhook interception surface. - Health check now asserts the quota CRs reconcile to Active (assert-only, read-only allowlist compliant); documented coupling to the default CR names for overlays overriding manifestFiles. - Docs: registry field reference, catalog entry incl. upgrade/uninstall caveats and health-check coupling, BOM regen. Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
Kueue was registered in the component registry but referenced by zero overlays and shipped no queue or quota CRs, so a deployed Kueue admitted nothing out of the box. - Add registry-level manifestFiles defaults to ComponentConfig: a component can now ship default manifests wherever a recipe references it; ref-declared (overlay/mixin) lists take precedence. No opt-out: an empty ref-declared list is indistinguishable from absent — declare a replacement list to suppress the defaults. - Fail closed at registry load when a Kustomize-typed component declares manifestFiles: validateComponentRef rejects the combination per-ref, so a registry-level mistake would otherwise surface at resolution time in every consumer at once. - Mark kueue manifestsUseChartCRDs: the quota CRs instantiate CRDs the chart itself installs, so the injected kueue-post wrapper needs the helm-diff REST-mapper bypass (NVIDIA#914/NVIDIA#929 pattern, added in NVIDIA#1687). - Bump kueue chart 0.17.1 -> 0.18.2 and ship default quota CRs (ResourceFlavor with GPU-taint toleration, ClusterQueue with admission-neutral quotas, LocalQueue default/default) as post-install hooks ordered by dependency. - Pin managerConfig to the chart 0.18.2 default with integrations.frameworks trimmed to batch/job, JobSet, TrainJob - drops the default-on pod/deployment/statefulset webhook interception surface. - Health check now asserts the quota CRs reconcile to Active (assert-only, read-only allowlist compliant); documented coupling to the default CR names for overlays overriding manifestFiles. - Docs: registry field reference, catalog entry incl. upgrade/uninstall caveats and health-check coupling, BOM regen. Review fixes (PR NVIDIA#1686 non-blocking review): mark manifestsUseChartCRDs on kueue per NVIDIA#1687 coordination; fail closed at registry load when a Kustomize-typed component declares manifestFiles; assert the load-time guard returns ErrCodeInvalidRequest in its test; health-check, catalog, and godoc coupling notes for manifestFiles overrides; single-default-flavor toleration trade-off note. Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
Kueue was registered in the component registry but referenced by zero overlays and shipped no queue or quota CRs, so a deployed Kueue admitted nothing out of the box. - Add registry-level manifestFiles defaults to ComponentConfig: a component can now ship default manifests wherever a recipe references it; ref-declared (overlay/mixin) lists take precedence. No opt-out: an empty ref-declared list is indistinguishable from absent — declare a replacement list to suppress the defaults. - Fail closed at registry load when a Kustomize-typed component declares manifestFiles: validateComponentRef rejects the combination per-ref, so a registry-level mistake would otherwise surface at resolution time in every consumer at once. - Mark kueue manifestsUseChartCRDs: the quota CRs instantiate CRDs the chart itself installs, so the injected kueue-post wrapper needs the helm-diff REST-mapper bypass (NVIDIA#914/NVIDIA#929 pattern, added in NVIDIA#1687). - Bump kueue chart 0.17.1 -> 0.18.2 and ship default quota CRs (ResourceFlavor with GPU-taint toleration, ClusterQueue with admission-neutral quotas, LocalQueue default/default) as post-install hooks ordered by dependency. - Pin managerConfig to the chart 0.18.2 default with integrations.frameworks trimmed to batch/job, JobSet, TrainJob - drops the default-on pod/deployment/statefulset webhook interception surface. - Health check now asserts the quota CRs reconcile to Active (assert-only, read-only allowlist compliant); documented coupling to the default CR names for overlays overriding manifestFiles. - Docs: registry field reference, catalog entry incl. upgrade/uninstall caveats and health-check coupling, BOM regen. Review fixes (PR NVIDIA#1686 non-blocking review): mark manifestsUseChartCRDs on kueue per NVIDIA#1687 coordination; fail closed at registry load when a Kustomize-typed component declares manifestFiles; assert the load-time guard returns ErrCodeInvalidRequest in its test; health-check, catalog, and godoc coupling notes for manifestFiles overrides; single-default-flavor toleration trade-off note. Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
Kueue was registered in the component registry but referenced by zero overlays and shipped no queue or quota CRs, so a deployed Kueue admitted nothing out of the box. - Add registry-level manifestFiles defaults to ComponentConfig: a component can now ship default manifests wherever a recipe references it; ref-declared (overlay/mixin) lists take precedence. No opt-out: an empty ref-declared list is indistinguishable from absent — declare a replacement list to suppress the defaults. - Fail closed at registry load when a Kustomize-typed component declares manifestFiles: validateComponentRef rejects the combination per-ref, so a registry-level mistake would otherwise surface at resolution time in every consumer at once. - Mark kueue manifestsUseChartCRDs: the quota CRs instantiate CRDs the chart itself installs, so the injected kueue-post wrapper needs the helm-diff REST-mapper bypass (NVIDIA#914/NVIDIA#929 pattern, added in NVIDIA#1687). - Bump kueue chart 0.17.1 -> 0.18.2 and ship default quota CRs (ResourceFlavor with GPU-taint toleration, ClusterQueue with admission-neutral quotas, LocalQueue default/default) as post-install hooks ordered by dependency. - Pin managerConfig to the chart 0.18.2 default with integrations.frameworks trimmed to batch/job, JobSet, TrainJob - drops the default-on pod/deployment/statefulset webhook interception surface. - Health check now asserts the quota CRs reconcile to Active (assert-only, read-only allowlist compliant); documented coupling to the default CR names for overlays overriding manifestFiles. - Docs: registry field reference, catalog entry incl. upgrade/uninstall caveats and health-check coupling, BOM regen. Review fixes (PR NVIDIA#1686 non-blocking review): mark manifestsUseChartCRDs on kueue per NVIDIA#1687 coordination; fail closed at registry load when a Kustomize-typed component declares manifestFiles; assert the load-time guard returns ErrCodeInvalidRequest in its test; health-check, catalog, and godoc coupling notes for manifestFiles overrides; single-default-flavor toleration trade-off note. Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
…VIDIA#1687) Signed-off-by: Mark Chmarny <[email protected]>
Summary
Helmfile bundles now emit
disableValidation: trueon an injected-postwrapper release when its manifests instantiate CRs of CRDs the parent chart installs, via a new registry flagmanifestsUseChartCRDs(set onnetwork-operator). Fixes fresh-clusterhelmfile applyfailing withno matches for kind "NicClusterPolicy" in version "mellanox.com/v1alpha1".Motivation / Context
The AKS overlay attaches
nic-cluster-policy-aks.yaml(aNicClusterPolicyCR) asmanifestFilesonnetwork-operator; the bundler wraps it into the injectednetwork-operator-postrelease. That wrapper shares the parent's sub-helmfile level, and helmfile diffs every release in a level before applying any — theneeds:edge orders apply, not diff — so on a fresh cluster helm-diff's REST-mapper check runs before the parent has installed the CRDs and can never pass. The existingdisableValidationmitigation (#914) is deliberately scoped to primary releases (#929), which didn't account for wrapper manifests depending on parent-shipped CRDs.Fixes: #1666
Related: #914, #929
Type of Change
Component(s) Affected
pkg/recipe)pkg/bundler,pkg/component/*)docs/,examples/)Implementation Notes
manifestsUseChartCRDsmirrorshasSelfRefCRDs([Bug]: helmfile bundle fails on fresh cluster — CRD/CR render order between nodewright-operator and nodewright-customizations #914) and is plumbed through the samecomponentFlagspath; emission is scoped tof.Name == f.Parent+"-post"so primary releases and-prewrappers (whose manifests apply before the chart and cannot depend on its CRDs) keep helm-diff's mapper typo-check per refine(bundler): scope disableValidation: true to primary release, not -pre/-post wrapper folders #929.make bom-docsrun: no change (comment/flag-only registry edit).Testing
make qualify # PASSTestBuildHelmfile_DisableValidationPostManifestspins pre/primary/post emission (written first, red on the missing field).pkg/bundler/deployer/helmfile85.6% → 86.9% (+1.3%).aicr-test1, K8s 1.35.5) that reproduced helmfile: fresh-cluster apply fails diff on -post wrappers referencing parent-shipped CRDs #1666: with the flag emitted, the previously-fatalnetwork-operator-postdiff passes,helmfile applycompletes (exit 0), and theNicClusterPolicyCR is created; regenerating the bundle from the same recipe with the patched binary emitsdisableValidation: trueonnetwork-operator-postautomatically.Risk Assessment
Rollout notes: Only affects newly generated helmfile bundles for recipes whose components carry the new flag (today:
network-operatorwith attached manifests, i.e. AKS). Existing bundles are unchanged; regenerate to pick up the fix.Checklist
make testwith-race)make lint)git commit -S) — GPG signing info