Skip to content

Commit

Permalink
fix del bridge err
Browse files Browse the repository at this point in the history
Signed-off-by: wangs <[email protected]>
  • Loading branch information
wangwangyusur288 committed Sep 5, 2024
1 parent f2e6827 commit aec4fb0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/daemon/gateway_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -1422,6 +1422,12 @@ func (c *Controller) setExGateway() error {
klog.Errorf("failed to get node, %v", err)
return err
}
var isUserspaceDP bool
isUserspaceDP, err = ovs.IsUserspaceDataPath()
if err != nil {
klog.Error(err)
return err
}
enable := node.Labels[util.ExGatewayLabel]
externalBridge := util.ExternalBridgeName(c.config.ExternalGatewaySwitch)
if enable == "true" {
Expand All @@ -1438,12 +1444,6 @@ func (c *Controller) setExGateway() error {
return err
}

isUserspaceDP, err := ovs.IsUserspaceDataPath()
if err != nil {
klog.Error(err)
return err
}

if !isUserspaceDP {
link, err := netlink.LinkByName(linkName)
if err != nil {
Expand Down Expand Up @@ -1523,7 +1523,7 @@ func (c *Controller) setExGateway() error {
}
}

if !keepExternalSubnet {
if !isUserspaceDP && !keepExternalSubnet {
klog.Infof("delete external bridge %s", externalBridge)
if _, err := ovs.Exec(
ovs.IfExists, "del-br", externalBridge); err != nil {
Expand Down

0 comments on commit aec4fb0

Please sign in to comment.