diff --git a/pkg/controller/pod.go b/pkg/controller/pod.go index 59163cb06e1..ffd61a3ca28 100644 --- a/pkg/controller/pod.go +++ b/pkg/controller/pod.go @@ -1271,7 +1271,7 @@ func (c *Controller) syncVmLiveMigrationPort() { // lists pods with the same IP address vmLsps, err := c.ovnClient.ListLogicalEntity("logical_switch_port", fmt.Sprintf("external_ids:ls=%s", subnet.Name), - fmt.Sprintf("external_ids:ip=%s", strings.ReplaceAll(addr.Spec.IPAddress, ",", "/"))) + fmt.Sprintf("external_ids:ip=\"%s\"", strings.ReplaceAll(addr.Spec.IPAddress, ",", "/"))) if err != nil { klog.Errorf("list logical_switch_port failed, %v", err) return diff --git a/pkg/ovs/ovn-nbctl.go b/pkg/ovs/ovn-nbctl.go index 82f4d952fa1..60a4804f53b 100644 --- a/pkg/ovs/ovn-nbctl.go +++ b/pkg/ovs/ovn-nbctl.go @@ -196,7 +196,7 @@ func (c Client) CreatePort(ls, port, ip, mac, pod, namespace string, portSecurit ports, err := c.ListLogicalEntity("logical_switch_port", fmt.Sprintf("external_ids:ls=%s", ls), - fmt.Sprintf("external_ids:ip=%s", strings.ReplaceAll(ip, ",", "/"))) + fmt.Sprintf("external_ids:ip=\"%s\"", strings.ReplaceAll(ip, ",", "/"))) if err != nil { klog.Errorf("list logical entity failed: %v", err) return err