Skip to content
This repository was archived by the owner on May 6, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pkg/inventory/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,9 @@ func addPCIAttributes(device *resourceapi.Device, ifName string, path string) {
}

func setPciRootAttr(device *resourceapi.Device, address *pciAddress) error {
pcieRootAttr, err := deviceattribute.GetPCIeRootAttributeByPCIBusID(address.bus)
// TODO(#199): Investigate ways to test correctness of PCI attributes
// discovery e2e (like standard PCI root attribute)
pcieRootAttr, err := deviceattribute.GetPCIeRootAttributeByPCIBusID(address.String())
if err != nil {
return err
}
Expand Down
7 changes: 7 additions & 0 deletions pkg/inventory/sysfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ type pciAddress struct {
function string
}

func (a pciAddress) String() string {
if a.domain == "" {
return fmt.Sprintf("%s:%s.%s", a.bus, a.device, a.function)
}
return fmt.Sprintf("%s:%s:%s.%s", a.domain, a.bus, a.device, a.function)
Comment thread
gauravkghildiyal marked this conversation as resolved.
}

// The PCI root is the root PCI device, derived from the
// pciAddress of a device. Spec is defined from the DRA KEP.
// https://github.com/kubernetes/enhancements/pull/5316
Expand Down
Loading