Skip to content

Commit

Permalink
numalign: compat with newer sriov device plugins
Browse files Browse the repository at this point in the history
Starting OCP >= 4.13 the SRIOV device plugin is also exporting device info as JSON snippet.
We need to avoid that because it confuses our logic.

Signed-off-by: Francesco Romani <[email protected]>
  • Loading branch information
ffromani committed Jun 5, 2023
1 parent 3f5af11 commit 93666d1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/pkg/numalign/numalign.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ func GetPCIDevicesFromEnv(environ []string) []string {
if !strings.HasPrefix(envVar, "PCIDEVICE_") {
continue
}
if strings.Contains(envVar, "_INFO=") {
// sriov device plugin found in OpenShift >= 4.13 (TODO: narro down version)
continue
}
pair := strings.SplitN(envVar, "=", 2)
pciDevs = append(pciDevs, pair[1])
}
Expand Down

0 comments on commit 93666d1

Please sign in to comment.