Skip to content

Commit 864f2c6

Browse files
authored
issue#6181 lb的IPPortMappings不为空时,不允许忽略IPPortMapping (#6182)
Signed-off-by: tongruishan <tongruishan@cnpc.com.cn>
1 parent 3328759 commit 864f2c6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/ovs/ovn-nb-load_balancer.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,14 @@ func (c *OVNNbClient) LoadBalancerDeleteVip(lbName, vipEndpoint string, ignoreHe
149149
lbhc *ovnnb.LoadBalancerHealthCheck
150150
err error
151151
)
152-
153152
lb, lbhc, err = c.GetLoadBalancerHealthCheck(lbName, vipEndpoint, true)
154153
if err != nil {
155154
klog.Errorf("failed to get lb health check: %v", err)
156155
return err
157156
}
157+
if len(lb.IPPortMappings) != 0 {
158+
ignoreHealthCheck = false
159+
}
158160
if !ignoreHealthCheck && lbhc != nil {
159161
klog.Infof("clean health check for lb %s with vip %s", lbName, vipEndpoint)
160162
// delete ip port mapping

0 commit comments

Comments
 (0)