Skip to content

Commit

Permalink
fix: check chassis before creation
Browse files Browse the repository at this point in the history
Signed-off-by: bobz965 <[email protected]>
  • Loading branch information
zbb88888 committed Dec 4, 2023
1 parent fc76977 commit 2495155
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/ovs/ovn-nb-gateway_chassis.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,15 @@ func (c *OVNNbClient) CreateGatewayChassisesOp(lrpName string, chassises []strin

for i, chassisName := range chassises {
gwChassisName := lrpName + "-" + chassisName
gwChassis, err := c.newGatewayChassis(gwChassisName, chassisName, 100-i)
gwChassis, err := c.GetGatewayChassis(chassisName, true)
if err != nil {
klog.Error(err)
return nil, err
}
if gwChassis != nil {
continue
}
gwChassis, err = c.newGatewayChassis(gwChassisName, chassisName, 100-i)
if err != nil {
klog.Error(err)
return nil, err
Expand Down

0 comments on commit 2495155

Please sign in to comment.