Skip to content

fix: make Spectrum-X deploy validation idempotent - #149

Merged
almaslennikov merged 1 commit into
mainfrom
fix/spectrumx-deploy-validation
Jul 31, 2026
Merged

fix: make Spectrum-X deploy validation idempotent#149
almaslennikov merged 1 commit into
mainfrom
fix/spectrumx-deploy-validation

Conversation

@almaslennikov

Copy link
Copy Markdown
Collaborator

Summary

  • stop NicConfigurationTemplate validation from waiting on FirmwareUpdateInProgress when the matched NicDevice has no spec.firmware
  • exclude Spectrum-X operator-generated SriovNetworkPoolConfig, SriovNetworkNodePolicy, and OVSNetwork objects from stray-resource preflight using the spectrumx.nvidia.com/owner-name label
  • keep unlabelled resources of those kinds subject to normal conflict detection and overwrite remediation
  • add regression coverage and update deploy/validation documentation and skills

Validation

  • TMPDIR=/Users/amaslennikov/workspace/tmp/l8k-spectrumx-go-tmp CGO_ENABLED=0 go test ./...
  • TMPDIR=/Users/amaslennikov/workspace/tmp/l8k-spectrumx-go-tmp CGO_ENABLED=0 go build ./...
  • git diff --check upstream/main...HEAD

Not run locally: make lint, because golangci-lint is not installed.

Signed-off-by: Alexander Maslennikov <amaslennikov@nvidia.com>
@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown

Greptile Summary

Makes Spectrum-X deployment validation idempotent by:

  • Ignoring stale firmware conditions for configuration-only NicDevices without spec.firmware.
  • Excluding labeled Spectrum-X operator-generated SR-IOV and OVS child resources from stray-resource detection.
  • Adding regression tests and documenting the revised validation behavior.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security defects identified.

The changed validation predicates align with the documented Spectrum-X ownership and NicDevice firmware contracts, and regression tests cover both the intended exemptions and preserved conflict detection.

Important Files Changed

Filename Overview
pkg/networkoperatorplugin/crstate/nicconfig.go Gates firmware-condition validation on the presence of spec.firmware, preventing stale firmware status from blocking configuration-only deployments.
pkg/networkoperatorplugin/crstate/nicconfig_test.go Updates firmware-gating coverage and adds a regression test for stale firmware conditions when no firmware specification is present.
pkg/networkoperatorplugin/preflight/strays.go Exempts the three documented Spectrum-X child resource kinds from stray detection when they carry the operator ownership label.
pkg/networkoperatorplugin/preflight/strays_test.go Verifies labeled child resources are excluded while unlabeled resources and other labeled kinds remain subject to conflict detection.

Reviews (1): Last reviewed commit: "fix: make Spectrum-X deploy validation i..." | Re-trigger Greptile

@almaslennikov
almaslennikov merged commit fbff4cc into main Jul 31, 2026
12 checks passed
@almaslennikov
almaslennikov deleted the fix/spectrumx-deploy-validation branch August 5, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant