Skip to content

Commit

Permalink
fix: noAllowLiveMigration port can't sync vips (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
h807892124 authored and oilbeater committed Sep 22, 2022
1 parent 474206b commit 76541ef
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/ovs/ovn-nbctl-legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,13 @@ func (c LegacyClient) CreatePort(ls, port, ip, mac, pod, namespace string, portS
addresses = append(addresses, strings.Split(ip, ",")...)
ovnCommand = []string{MayExist, "lsp-add", ls, port}
isAddrConflict := false
if liveMigration {
// add external_id info as the filter of 'live Migration vm port'
ovnCommand = append(ovnCommand,
"--", "set", "logical_switch_port", port, fmt.Sprintf("external_ids:ls=%s", ls),
"--", "set", "logical_switch_port", port, fmt.Sprintf("external_ids:ip=%s", strings.ReplaceAll(ip, ",", "/")))

// add external_id info
ovnCommand = append(ovnCommand,
"--", "set", "logical_switch_port", port, fmt.Sprintf("external_ids:ls=%s", ls),
"--", "set", "logical_switch_port", port, fmt.Sprintf("external_ids:ip=%s", strings.ReplaceAll(ip, ",", "/")))

if liveMigration {
ports, err := c.ListLogicalEntity("logical_switch_port",
fmt.Sprintf("external_ids:ls=%s", ls),
fmt.Sprintf("external_ids:ip=\"%s\"", strings.ReplaceAll(ip, ",", "/")))
Expand Down

0 comments on commit 76541ef

Please sign in to comment.