From fd3bd44cdbcb655b76ff201c650b9a55e949304a Mon Sep 17 00:00:00 2001 From: liyh-yusur Date: Fri, 30 Aug 2024 18:30:26 +0800 Subject: [PATCH] when using vf, set pod_nic_type to sriov Signed-off-by: liyh-yusur --- pkg/daemon/ovs_linux.go | 1 + pkg/util/const.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/pkg/daemon/ovs_linux.go b/pkg/daemon/ovs_linux.go index 3bc89172857..efec4b27056 100644 --- a/pkg/daemon/ovs_linux.go +++ b/pkg/daemon/ovs_linux.go @@ -151,6 +151,7 @@ func (csh cniServerHandler) configureNic(podName, podNamespace, provider, netns, oriPod := pod.DeepCopy() pod.Annotations[fmt.Sprintf(util.VfRepresentorNameTemplate, provider)] = hostNicName pod.Annotations[fmt.Sprintf(util.VfNameTemplate, provider)] = containerNicName + pod.Annotations[fmt.Sprintf(util.PodNicAnnotationTemplate, provider)] = util.SriovNicType var patch []byte patch, err = util.GenerateMergePatchPayload(oriPod, pod) if err != nil { diff --git a/pkg/util/const.go b/pkg/util/const.go index 17f12566259..d401efa8369 100644 --- a/pkg/util/const.go +++ b/pkg/util/const.go @@ -170,6 +170,8 @@ const ( SRIOVResourceName = "mellanox.com/cx5_sriov_switchdev" + SriovNicType = "sriov" + InterconnectionConfig = "ovn-ic-config" ExternalGatewayConfig = "ovn-external-gw-config" InterconnectionSwitch = "ts"