Skip to content
This repository was archived by the owner on Dec 9, 2025. It is now read-only.

Commit 5046f5d

Browse files
committed
feat: add pcieroot as a standard value
kubernetes/enhancements#5316 provides a standardized device attribute for pcieroot. Use that definition.
1 parent 1627d9e commit 5046f5d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/inventory/db.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,12 @@ func addPCIAttributes(device *resourceapi.BasicDevice, ifName string, path strin
308308
if address.function != "" {
309309
device.Attributes["dra.net/pciAddressFunction"] = resourceapi.DeviceAttribute{StringValue: &address.function}
310310
}
311+
if address.domain != "" && address.bus != "" {
312+
// standardized attribute for all dra drivers
313+
// ref: https://github.com/kubernetes/enhancements/pull/5316
314+
pcieRoot := fmt.Sprintf("pci%s:%s", address.domain, address.bus)
315+
device.Attributes["resource.kubernetes.io/pcieRoot"] = resourceapi.DeviceAttribute{StringValue: &pcieRoot}
316+
}
311317
} else {
312318
klog.Infof("could not get pci address : %v", err)
313319
}

0 commit comments

Comments
 (0)