Skip to content

Commit 98ae47d

Browse files
authored
Merge pull request #229 from chengxiangdong/fix_del
fix the issue when EIP is empty
2 parents f694c0c + 20bcac7 commit 98ae47d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pkg/cloudprovider/huaweicloud/dedicatedloadbalancer.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -864,11 +864,13 @@ func (d *DedicatedLoadBalancer) deleteELBInstance(loadBalancer *elbmodel.LoadBal
864864
return nil
865865
}
866866

867-
eipID := getStringFromSvsAnnotation(service, ElbEipID, "")
867+
lbEIP := ""
868+
if len(loadBalancer.Eips) > 0 && loadBalancer.Eips[0].EipId != nil {
869+
lbEIP = *loadBalancer.Eips[0].EipId
870+
}
871+
eipID := getStringFromSvsAnnotation(service, ElbEipID, lbEIP)
868872
if eipID == "" {
869-
if eipID == "" && len(loadBalancer.Eips) > 0 && loadBalancer.Eips[0].EipId != nil {
870-
eipID = *loadBalancer.Eips[0].EipId
871-
}
873+
return nil
872874
}
873875

874876
klog.Infof("deleting unbind EIP: %v", eipID)

0 commit comments

Comments
 (0)