From c830594dc5b9575531b34eea358bad019d0ff3a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E6=97=A5=E6=98=8E?= Date: Tue, 11 Jan 2022 17:27:38 +0800 Subject: [PATCH] fix: liveMigration with IPv6 --- pkg/controller/pod.go | 2 +- pkg/ovs/ovn-nbctl.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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