-
Notifications
You must be signed in to change notification settings - Fork 297
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
Cleanup L4 ILB IP Reservation in all cases. #1181
Conversation
@freehan This is now ready for review. |
@@ -261,6 +261,12 @@ func (l *L4) ensureForwardingRule(loadBalancerName, bsLink string, options gce.I | |||
return nil, err | |||
} | |||
klog.V(2).Infof("ensureForwardingRule(%v): reserved IP %q for the forwarding rule", loadBalancerName, ipToUse) | |||
defer func() { | |||
// Now that the controller knows the forwarding rule exists, we can release the address. |
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.
add a comment to explain: why no need to hold the address after the forwarding rule exists?
Plus, the following logic may also fail right? For instance, the following logic hit a quota limit and failed to create forwarding rule?
So I guess, it should always release the address to avoid leaking address?
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.
Yes that's correct. I fixed the comment.
Reservation for IP is made for new FR, updated FR and periodic sync. Cleanup reservation after FR has been ensured in all cases.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: freehan, 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 follow up to #1179, the previous PR cleaned up the reservation in case of new Forwarding rule creation or on updates. But, reservation also happens during periodic syncs which need to be cleaned up.
/assign @freehan @bowei