Skip to content

Commit b1ba42a

Browse files
oilbeaterclaude
andcommitted
fix(slr): handle IsNotFound when deleting VIP CRD in handleDelSwitchLBRule
When multiple SLR controllers process deletion for SLRs sharing the same subnet (via the fallback path), both may attempt to delete the same VIP CRD. The second deletion gets an IsNotFound error, which previously caused an unnecessary error and retry loop. Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 053eafb commit b1ba42a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/controller/switch_lb_rule.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ func (c *Controller) handleDelSwitchLBRule(info *SlrInfo) error {
297297

298298
if len(lbhcs) == 0 {
299299
err = c.config.KubeOvnClient.KubeovnV1().Vips().Delete(context.Background(), vip, metav1.DeleteOptions{})
300-
if err != nil {
300+
if err != nil && !k8serrors.IsNotFound(err) {
301301
klog.Errorf("failed to delete vip %s for load balancer health check, err: %v", vip, err)
302302
return err
303303
}

0 commit comments

Comments
 (0)