-
Notifications
You must be signed in to change notification settings - Fork 540
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 Create events for Elastic IP allocate/disassociate/release #1447
Conversation
also make related errors more consistent
@@ -121,7 +124,8 @@ func (s *Service) releaseAddresses() error { | |||
AssociationId: ip.AssociationId, | |||
}) | |||
if err != nil { | |||
return errors.Errorf("failed to release elastic IP %q with allocation ID %q: Still associated with association ID %q", *ip.PublicIp, *ip.AllocationId, *ip.AssociationId) | |||
record.Warnf(s.scope.AWSCluster, "FailedDisassociateEIP", "Failed to disassociate Elastic IP %q: %v", *ip.AllocationId, err) | |||
return errors.Errorf("failed to disassociate Elastic IP %q with allocation ID %q: Still associated with association ID %q", *ip.PublicIp, *ip.AllocationId, *ip.AssociationId) |
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.
Not directly related to this PR, but it seems really odd that we are disassociating here, but also calling the disassociateAddress
method below in the error block for the call to s.scope.EC2.ReleaseAddress
below... I'm wondering if we need to replace the call to s.scope.EC2.DisassociateAddress
here to a call to disassociateAddress
here, or just remove it and let it be handled below with the error handling when trying to 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.
I mentioned that it looked odd to @vincepri and he said there was a reason for it (which I've not forgotten)... help?
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.
I could see issues related to the eventual consistency of the API, but that could be handled by just retrying the call to release. There is also the case for the EIP associated with the NAT gateway, which we cannot disassociate or release until some background processes complete, but we could handle that by a call w/ retries to disassociateAddress
above the call to s.scope.EC2.ReleaseAddress
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.
should we open a new issue to track what @detiber raised as a potential issue? Or would you like to resolve the issues mentioned above in this PR?
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.
Followup issue sounds good.
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.
Follow up issue #1459 opened.
/lgtm |
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aaroniscode, vincepri 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 |
also make related errors more consistent
What this PR does / why we need it:
Calls to EC2 for Elastic IP's didn't generate events if there were errors. This PR creates those events.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #1346
Noticed some inconsistency around the related errors and made some very minor changes so they are consistent. Let me know if that's OK or if I should revert those changes.