From 4a9a1f8214223f273850bb53b19c82407de23621 Mon Sep 17 00:00:00 2001 From: xieyanker Date: Thu, 7 Mar 2024 11:08:59 +0800 Subject: [PATCH] Fix the failure to enable multi-network card traffic mirroring for newly created pods (#3805) Fix the failure to enable multi-network card traffic mirroring for newly created pods When the global traffic mirroring switch is not turned on, creating or restarting a pod with multiple Kube-OVN network cards, only the traffic mirroring of the main network card will take effect, and the traffic mirroring of the second network card will not work. Signed-off-by: xieyanker --- pkg/daemon/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/daemon/handler.go b/pkg/daemon/handler.go index 3638bd2a355..dc5be010d64 100644 --- a/pkg/daemon/handler.go +++ b/pkg/daemon/handler.go @@ -320,7 +320,7 @@ func (csh cniServerHandler) handleAdd(req *restful.Request, resp *restful.Respon } ifaceID := ovs.PodNameToPortName(podRequest.PodName, podRequest.PodNamespace, podRequest.Provider) - if err = ovs.ConfigInterfaceMirror(csh.Config.EnableMirror, pod.Annotations[util.MirrorControlAnnotation], ifaceID); err != nil { + if err = ovs.ConfigInterfaceMirror(csh.Config.EnableMirror, pod.Annotations[fmt.Sprintf(util.MirrorControlAnnotationTemplate, podRequest.Provider)], ifaceID); err != nil { klog.Errorf("failed mirror to mirror0, %v", err) return }