Skip to content

Commit

Permalink
add label to avoid deleting other
Browse files Browse the repository at this point in the history
  • Loading branch information
lut777 committed May 27, 2021
1 parent d03201e commit 31a96f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/ovs/ovn-nbctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (c Client) CreatePort(ls, port, ip, cidr, mac, tag, pod, namespace string,

if pod != "" && namespace != "" {
ovnCommand = append(ovnCommand,
"--", "set", "logical_switch_port", port, fmt.Sprintf("external_ids:pod=%s/%s", namespace, pod))
"--", "set", "logical_switch_port", port, fmt.Sprintf("external_ids:pod=%s/%s", namespace, pod), fmt.Sprintf("external_ids:vendor=%s", util.CniTypeName))
}

if _, err := c.ovnNbCommand(ovnCommand...); err != nil {
Expand Down Expand Up @@ -346,7 +346,7 @@ func (c Client) LogicalSwitchExists(logicalSwitch string) (bool, error) {
}

func (c Client) ListLogicalSwitchPort() ([]string, error) {
output, err := c.ovnNbCommand("--format=csv", "--data=bare", "--no-heading", "--columns=name", "find", "logical_switch_port", "type=\"\"")
output, err := c.ovnNbCommand("--format=csv", "--data=bare", "--no-heading", "--columns=name", "find", "logical_switch_port", "type=\"\"", fmt.Sprintf("external_ids:vendor=%s", util.CniTypeName))
if err != nil {
klog.Errorf("failed to list logical switch port, %v", err)
return nil, err
Expand Down

0 comments on commit 31a96f2

Please sign in to comment.