← Back to Pull requests

fix(bundler): reject network-operator bundles missing the nfd NIC rule #3446

Closed
unknown closed this pull request without merging on Oct 28, 2026 11:21 UTC
View on GitHub
unknown unknown commented on Oct 27, 2026 18:21 UTC
Author

Summary

aicr bundle now fails, instead of warning, when a bundle ships network-operator without the nfd-worker rule that labels NIC nodes feature.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 the os-talos mixin adds it, and the Talos integration guide says so.

Motivation / Context

Since #3127, nfd-worker no longer publishes pci., so network-operator's NodeFeatureRule cannot set the NIC label. An overlay that adds network-operator without selecting components/nfd/values-nvidia-nics.yaml (values-nvidia-nics-aks.yaml on 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

  • Bug fix (non-breaking change that fixes an issue)

  • New feature (non-breaking change that adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to change)

  • Documentation update

  • Refactoring (no functional changes)

  • Build/CI/tooling
  • Component(s) Affected

  • CLI (cmd/aicr, pkg/cli)

  • API server (cmd/aicrd, pkg/server)

  • Recipe engine / data (pkg/recipe)

  • Bundler and deployers (pkg/bundler, pkg/component)

  • Collectors / snapshotter (pkg/collector, pkg/snapshotter)

  • Validator (pkg/validator)

  • Core libraries (pkg/errors, pkg/k8s)

  • Docs/examples (docs/, examples/)

  • Other: ____________
  • Implementation Notes

    Error only where the check sees every input. #3127 kept this a warning because the check does not replay worker.extraArgs or labelsTemplate rules. This PR resolves that with coverage rather than a new opt-out flag:

  • The check returns ErrCodeInvalidRequest when network-operator is in the bundle, nfd strips pci.device, and no static worker.config.sources.custom rule sets the label.

  • It stays a warning when nfd sets an input the check does not evaluate. The warning says why. Those inputs are:

  • - worker.extraArgs, since nfd-worker -options can replace its config;
    - worker.config.sources.pci, since the built-in pci source emits pci-15b3.present with deviceLabelFields: [vendor];
    - a labelsTemplate rule;
    - a --dynamic nfd path that covers, or lies under, a label input (noPublishFeatures, sources.custom, extraArgs, sources.pci), since its value is set at install time.
  • nfd values are normalized through JSON before the check reads them. Typed SDK overrides (WithValueOverridesTypedPaths) keep Go types such as []string, which would otherwise be missed and turn a warning into a false error.

  • The error lists all three fixes: select the values file, include its rule in a sources.custom override, or publish pci.device again.

  • The reverse direction (the rule without network-operator) is unchanged and still a warning.
  • warnNFDNICLabelMismatch is renamed to checkNFDNICLabelMismatch, and Make returns 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.custom override, or publish pci. 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.md and can be carried into the next release's notes.

    Testing

    go test -race ./pkg/bundler/... ./pkg/client/... ./pkg/cli/...
    go test ./pkg/recipe/ -run 'TestNFDFeaturePublishingContract|TestNFDPub'
    golangci-lint run -c .golangci.yaml ./pkg/bundler/...
    make check-docs-filenames check-docs-mdx check-docs-mdx-parse check-docs-links
    make qualify
    

  • Bundler, client and CLI suites pass with -race. TestCheckNFDNICLabelMismatch and TestMakeNFDNICLabelMismatch cover:

  • - the error path, including empty extraArgs and an empty sources.pci;
    - the extraArgs, sources.pci, labelsTemplate and --dynamic warning paths, the last also through Make with config.WithDynamicValues, and a --dynamic path outside the label inputs that still errors;
    - typed SDK values: []string extraArgs and a []map sources.custom rule. Both fail with the JSON normalization removed;
    - the unchanged reverse warning.
  • The nfd feature-publishing contract tests pass, so every shipped overlay with network-operator still selects the rule.

  • golangci-lint: 0 issues. Docs gates pass.

  • make qualify passes, including lint, e2e, scan and the API diffs. Total coverage is 86.2% against the 83% threshold.
  • Risk Assessment

  • Low — Isolated change, well-tested, easy to revert

  • Medium — Touches multiple components or has broader impact

  • High — Breaking change, affects critical paths, or complex rollout
  • Rollout notes: Shipped recipes are unaffected. A custom or downstream overlay that adds network-operator without the NIC rule now fails at aicr bundle instead of shipping a bundle that drops the NIC label. That includes a Talos leaf built on a base without network-operator, since the os-talos mixin adds it. The error names the fix.

    Checklist

  • Tests pass locally (make test with -race)

  • Linter passes (make lint)

  • I did not skip/disable tests to make CI green

  • I added/updated tests for new functionality

  • I updated docs if user-facing behavior changed

  • Changes follow existing patterns in the codebase

  • Commits are signed off and cryptographically signed (git commit -s -S) — GPG signing info
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: yuanchen8911 Review duration: 1019m
    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
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%
    Repository