fix(bundler): reject network-operator bundles missing the nfd NIC rule #3446
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3446"
general
weight: 0.35
yuanchen8911
Summary
aicr bundlenow fails, instead of warning, when a bundle ships network-operator without the nfd-worker rule that labels NIC nodesfeature.node.kubernetes.io/pci-15b3.present. The component catalog gains an Upgrade Notes entry for custom overlays that add network-operator, including a Talos leaf where theos-talosmixin adds it, and the Talos integration guide says so.Motivation / Context
Since #3127, nfd-worker no longer publishes
pci., so network-operator'sNodeFeatureRulecannot set the NIC label. An overlay that adds network-operator without selectingcomponents/nfd/values-nvidia-nics.yaml(values-nvidia-nics-aks.yamlon AKS) loses the label once nfd-worker restarts. The NicClusterPolicy operands then leave those nodes.A downstream overlay repo hit this on its v1.1.0 bump. The bundles rendered with only a warning, verification passed, and the gap shipped.
Fixes: #3340
Related: N/A
Type of Change
Component(s) Affected
cmd/aicr,pkg/cli)cmd/aicrd,pkg/server)pkg/recipe)pkg/bundler,pkg/component)pkg/collector,pkg/snapshotter)pkg/validator)pkg/errors,pkg/k8s)docs/,examples/)Implementation Notes
Error only where the check sees every input. #3127 kept this a warning because the check does not replay
worker.extraArgsorlabelsTemplaterules. This PR resolves that with coverage rather than a new opt-out flag:ErrCodeInvalidRequestwhen network-operator is in the bundle, nfd stripspci.device, and no staticworker.config.sources.customrule sets the label.-
worker.extraArgs, since nfd-worker-optionscan replace its config;-
worker.config.sources.pci, since the built-in pci source emitspci-15b3.presentwithdeviceLabelFields: [vendor];- a
labelsTemplaterule;- a
--dynamicnfd path that covers, or lies under, a label input (noPublishFeatures,sources.custom,extraArgs,sources.pci), since its value is set at install time.WithValueOverridesTypedPaths) keep Go types such as[]string, which would otherwise be missed and turn a warning into a false error.sources.customoverride, or publishpci.deviceagain.warnNFDNICLabelMismatchis renamed tocheckNFDNICLabelMismatch, andMakereturns its error.No explicit opt-out. A cluster that labels NIC nodes outside NFD has no escape hatch beyond the three documented fixes: select the values file, include its rule in a
sources.customoverride, or publishpci.again. A flag would add CLI, API and docs surface for a case not yet seen.Release notes. The v1.1.0 release notes are not edited here. The Upgrade Notes entry lives in
docs/user/component-catalog.mdand can be carried into the next release's notes.Testing
-race.TestCheckNFDNICLabelMismatchandTestMakeNFDNICLabelMismatchcover:- the error path, including empty
extraArgsand an emptysources.pci;- the
extraArgs,sources.pci,labelsTemplateand--dynamicwarning paths, the last also throughMakewithconfig.WithDynamicValues, and a--dynamicpath outside the label inputs that still errors;- typed SDK values:
[]stringextraArgsand a[]mapsources.customrule. Both fail with the JSON normalization removed;- the unchanged reverse warning.
golangci-lint: 0 issues. Docs gates pass.make qualifypasses, including lint, e2e, scan and the API diffs. Total coverage is 86.2% against the 83% threshold.Risk Assessment
Rollout notes: Shipped recipes are unaffected. A custom or downstream overlay that adds network-operator without the NIC rule now fails at
aicr bundleinstead of shipping a bundle that drops the NIC label. That includes a Talos leaf built on a base without network-operator, since theos-talosmixin adds it. The error names the fix.Checklist
make testwith-race)make lint)git commit -s -S) — GPG signing info