Skip to content

Commit

Permalink
Fix the failure to enable multi-network card traffic mirroring for ne…
Browse files Browse the repository at this point in the history
…wly 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 <xjsisnice@gmail.com>
  • Loading branch information
xieyanker authored and zhangzujian committed Mar 7, 2024
1 parent 680ca67 commit e7fc6ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/daemon/handler.go
Expand Up @@ -343,7 +343,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
}
Expand Down

0 comments on commit e7fc6ea

Please sign in to comment.