Skip to content

Commit 02c2c18

Browse files
committed
[gateway] update syncNodeGateway to reduce nesting
Signed-off-by: Nadia Pinaeva <[email protected]>
1 parent cc8e9c8 commit 02c2c18

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

go-controller/pkg/ovn/gateway.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,21 +1402,21 @@ func (gw *GatewayManager) syncNodeGateway(
14021402
if err := gw.Cleanup(); err != nil {
14031403
return fmt.Errorf("error cleaning up gateway for node %s: %v", node.Name, err)
14041404
}
1405-
} else if hostSubnets != nil {
1406-
if err := gw.syncGatewayLogicalNetwork(
1407-
node,
1408-
l3GatewayConfig,
1409-
hostSubnets,
1410-
hostAddrs,
1411-
clusterSubnets,
1412-
grLRPJoinIPs, // the joinIP allocated to this node for this controller's network
1413-
joinSwitchIPs, // the .1 of this controller's global joinSubnet
1414-
externalIPs,
1415-
); err != nil {
1416-
return fmt.Errorf("error creating gateway for node %s: %v", node.Name, err)
1417-
}
1405+
return nil
14181406
}
1419-
return nil
1407+
if hostSubnets == nil {
1408+
return nil
1409+
}
1410+
return gw.syncGatewayLogicalNetwork(
1411+
node,
1412+
l3GatewayConfig,
1413+
hostSubnets,
1414+
hostAddrs,
1415+
clusterSubnets,
1416+
grLRPJoinIPs, // the joinIP allocated to this node for this controller's network
1417+
joinSwitchIPs, // the .1 of this controller's global joinSubnet
1418+
externalIPs,
1419+
)
14201420
}
14211421

14221422
func physNetName(netInfo util.NetInfo) string {

0 commit comments

Comments
 (0)