Skip to content

Commit

Permalink
fix: invalid syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
fanriming committed Dec 31, 2021
1 parent 90950da commit c4cc8f0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/ovs/ovn-nbctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ func (c Client) SetPortSecurity(portSecurity bool, port, mac, ipStr, vips string
if portSecurity {
addresses = append(addresses, mac)
addresses = append(addresses, strings.Split(ipStr, ",")...)
addresses = append(addresses, strings.Split(vips, ",")...)
if vips != "" {
addresses = append(addresses, strings.Split(vips, ",")...)
}
ovnCommand = append(ovnCommand, strings.Join(addresses, " "))
}

Expand Down Expand Up @@ -215,7 +217,9 @@ func (c Client) CreatePort(ls, port, ip, mac, pod, namespace string, portSecurit
}

if portSecurity {
addresses = append(addresses, strings.Split(vips, ",")...)
if vips != "" {
addresses = append(addresses, strings.Split(vips, ",")...)
}
ovnCommand = append(ovnCommand,
"--", "lsp-set-port-security", port, strings.Join(addresses, " "))

Expand Down

0 comments on commit c4cc8f0

Please sign in to comment.