diff --git a/pkg/util/nichelper/helper.go b/pkg/util/nichelper/helper.go index f632e1e1..6618ce76 100644 --- a/pkg/util/nichelper/helper.go +++ b/pkg/util/nichelper/helper.go @@ -5,8 +5,8 @@ import ( "os" "path/filepath" "strconv" + "strings" - ctlnetworkv1beta1 "github.com/harvester/harvester-network-controller/pkg/generated/controllers/network.harvesterhci.io/v1beta1" "github.com/jaypipes/ghw" "github.com/jaypipes/ghw/pkg/net" ctlcorev1 "github.com/rancher/wrangler/pkg/generated/controllers/core/v1" @@ -18,6 +18,8 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/json" + ctlnetworkv1beta1 "github.com/harvester/harvester-network-controller/pkg/generated/controllers/network.harvesterhci.io/v1beta1" + "github.com/harvester/pcidevices/pkg/util/common" "github.com/harvester/pcidevices/pkg/apis/devices.harvesterhci.io/v1beta1" @@ -271,7 +273,7 @@ func generateSRIOVDeviceObjects(nodeName string, nics *net.Info, skipNics []stri func generateSRIOVDev(nodeName string, nic *net.NIC) *v1beta1.SRIOVNetworkDevice { return &v1beta1.SRIOVNetworkDevice{ ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("%s-%s", nodeName, nic.Name), + Name: strings.ToLower(fmt.Sprintf("%s-%s", nodeName, nic.Name)), Labels: map[string]string{ v1beta1.NodeKeyName: nodeName, },