diff --git a/cluster/kube/operators/clients/inventory/inventory.go b/cluster/kube/operators/clients/inventory/inventory.go index c8bc8e3c..7879fdc7 100644 --- a/cluster/kube/operators/clients/inventory/inventory.go +++ b/cluster/kube/operators/clients/inventory/inventory.go @@ -153,7 +153,7 @@ func tryAdjustGPU(rp *inventoryV1.GPU, res *types.GPU, sparams *crd.SchedulerPar continue } - if (attr.Interface != "") && (attr.Interface != info.Interface) { + if (attr.Interface != "") && (attr.Interface != ctypes.FilterGPUInterface(info.Interface)) { continue } } diff --git a/cluster/types/v1beta3/types.go b/cluster/types/v1beta3/types.go index bf6d2202..a5e3eadd 100644 --- a/cluster/types/v1beta3/types.go +++ b/cluster/types/v1beta3/types.go @@ -4,6 +4,7 @@ import ( "bufio" "context" "io" + "strings" inventoryV1 "github.com/akash-network/akash-api/go/inventory/v1" mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" @@ -160,3 +161,15 @@ type HostnameServiceClient interface { CanReserveHostnames(hostnames []string, ownerAddr sdktypes.Address) error PrepareHostnamesForTransfer(ctx context.Context, hostnames []string, leaseID mtypes.LeaseID) error } + +// FilterGPUInterface ensures interface values are always lower case +// generalizes sxm* to sxm +func FilterGPUInterface(val string) string { + val = strings.ToLower(val) + + if strings.HasPrefix(val, "sxm") { + val = "sxm" + } + + return val +} diff --git a/operator/inventory/node-discovery.go b/operator/inventory/node-discovery.go index c2991534..9641adf1 100644 --- a/operator/inventory/node-discovery.go +++ b/operator/inventory/node-discovery.go @@ -27,6 +27,7 @@ import ( v1 "github.com/akash-network/akash-api/go/inventory/v1" "github.com/akash-network/provider/cluster/kube/builder" + ctypes "github.com/akash-network/provider/cluster/types/v1beta3" "github.com/akash-network/provider/tools/fromctx" ) @@ -813,7 +814,7 @@ func generateLabels(cfg Config, knode *corev1.Node, node v1.Node, sc storageClas } if info.Interface != "" { - key := fmt.Sprintf("%s.interface.%s", key, info.Interface) + key := fmt.Sprintf("%s.interface.%s", key, ctypes.FilterGPUInterface(info.Interface)) if val, exists := res[key]; exists { nval, _ := strconv.ParseUint(val, 10, 32) nval++