New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for GCE finalizer in GetLoadBalancer. #91392
Conversation
/sig network |
/assign @MrHohn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
/approve
@@ -317,10 +319,12 @@ func (g *Cloud) ensureInternalLoadBalancerDeleted(clusterName, clusterID string, | |||
|
|||
// Try deleting instance groups - expect ResourceInuse error if needed by other LBs | |||
igName := makeInstanceGroupName(clusterID) | |||
klog.V(2).Infof("ensureInternalLoadBalancerDeleted(%v): attempting delete of instanceGroup %v", loadBalancerName, igName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Attempting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
require.NoError(t, err) | ||
if hasFinalizer(svc, ILBFinalizerV1) { | ||
t.Errorf("Finalizer '%s' not deleted from service - %v", ILBFinalizerV1, svc.Finalizers) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For completeness, could we trigger GetLoadBalancer()
one more time to make sure it return exists=false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea, done.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MrHohn, prameshj The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This is a more accurate check that looking for the forwarding rule, which could be deleted if delete flow was partially complete and abrupted by an upgrade, or if deleted by user manually. Added unit test. Addressed review comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
…92-upstream-release-1.18 Automated cherry pick of #91392: Check for GCE finalizer in GetLoadBalancer.
What type of PR is this?
What this PR does / why we need it:
This PR checks for GCE finalizer in GetLoadBalancer. This is a more accurate check that looking for the forwarding rule, which could be
deleted if delete flow was partially complete and abrupted by an upgrade, or if deleted by the user manually. GetLoadBalancer call is used to determine if LoadBalancer needs cleanup.
Added unit test.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: