Skip to content

Commit

Permalink
convert sriov device name objects to lowercase (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrokethecloud authored Sep 5, 2024
1 parent a20076c commit c0733b4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/util/nichelper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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,
},
Expand Down

0 comments on commit c0733b4

Please sign in to comment.