Skip to content

Commit 9a8c261

Browse files
committed
Fix: Target Pool are leaked when Forwarding Rule is deleted
Adding finalizer v1 check when checking if NetLB exists. If FR was deleted, the controller was thinking the LB did not exist anymore and skip cleaning up the Target Pool
1 parent c19c597 commit 9a8c261

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

providers/gce/gce_loadbalancer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func (g *Cloud) GetLoadBalancer(ctx context.Context, clusterName string, svc *v1
116116
}
117117
// Checking for finalizer is more accurate because controller restart could happen in the middle of resource
118118
// deletion. So even though forwarding rule was deleted, cleanup might not have been complete.
119-
if hasFinalizer(svc, ILBFinalizerV1) {
119+
if hasFinalizer(svc, ILBFinalizerV1) || hasFinalizer(svc, NetLBFinalizerV1) {
120120
return &v1.LoadBalancerStatus{}, true, nil
121121
}
122122
return nil, false, ignoreNotFound(err)

0 commit comments

Comments
 (0)