Guard VPD skip reporting behind discovery flag - #410
Conversation
Greptile SummaryThis PR updates VPD discovery failure handling for skipped-device reporting. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (3): Last reviewed commit: "Guard VPD skip reporting behind discover..." | Re-trigger Greptile |
| if skipDeviceOnDiscoveryError { | ||
| d.skipPhysicalDevice(statuses, pciKey, err) | ||
| } |
There was a problem hiding this comment.
Partial Device Survives VPD Failure
When one port of a multi-port NIC has already populated statuses[pciKey] and a later port fails GetVPD, this branch no longer removes the partially built physical device unless reporting is enabled. Discovery can return a NicDevice with only the earlier ports, so the controller reconciles a truncated device instead of treating the physical NIC as incompletely discovered.
| if skipDeviceOnDiscoveryError { | ||
| d.skipPhysicalDevice(statuses, pciKey, err) | ||
| } |
There was a problem hiding this comment.
Skipped Device Becomes Deletable
For a single-port NIC with an existing NicDevice CR, a GetVPD failure now returns no observed device and leaves SkippedDevices() empty when the flag is unset. The controller path that preserves skipped devices will not run, so the next reconcile can delete the CR for a physically present device that was only omitted because VPD discovery failed.
431b612 to
b6154fd
Compare
|
Addressed Greptile's VPD cleanup finding and force-pushed amended commit
Validation: |
| d.skippedDevices[pciKey] = err | ||
| } | ||
| continue |
There was a problem hiding this comment.
When GetVPD fails with SKIP_DEVICE_ON_DISCOVERY_ERROR unset, this branch removes the device from statuses but leaves skippedDevices empty. The controller then receives no observed device and no skipped marker for the PCI key, so an existing NicDevice CR for a physically present NIC can be treated as removed hardware and deleted. This is reachable for a single-port NIC whose VPD read fails, and for a multi-port NIC when a later port fails after an earlier port populated statuses. The discovery result can stay hidden from SkippedDevices() for reporting, but reconciliation still needs a preservation signal for devices omitted because discovery was incomplete.
Signed-off-by: Alexander Maslennikov <amaslennikov@nvidia.com>
b6154fd to
455acc6
Compare
|
Addressed the new Greptile P1 and force-pushed amended commit
Validation: |
Summary
SkippedDevices()unlessSKIP_DEVICE_ON_DISCOVERY_ERROR=trueTesting
go test ./pkg/devicediscovery/... -vgo build ./...git diff --checkNote: this follows up on the release backport review finding so
mainand the backport keep the same opt-in semantics.