From 39e920141e6f8b01c421946143e5c05c4892b858 Mon Sep 17 00:00:00 2001 From: bobz965 Date: Mon, 4 Dec 2023 13:59:54 +0800 Subject: [PATCH] fix: check chassis before creation (#3482) Signed-off-by: bobz965 --- pkg/ovs/ovn-nb-gateway_chassis.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/ovs/ovn-nb-gateway_chassis.go b/pkg/ovs/ovn-nb-gateway_chassis.go index 7ef57b82011..8a673f39d49 100644 --- a/pkg/ovs/ovn-nb-gateway_chassis.go +++ b/pkg/ovs/ovn-nb-gateway_chassis.go @@ -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