Skip to content
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

Merged
merged 1 commit into from
Dec 30, 2019
Merged

馃悰 Create events for Elastic IP allocate/disassociate/release #1447

merged 1 commit into from
Dec 30, 2019

Conversation

aaroniscode
Copy link
Contributor

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.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 23, 2019
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 23, 2019
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)
Copy link
Member

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?

Copy link
Contributor

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?

Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Followup issue sounds good.

Copy link
Contributor Author

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.

@detiber
Copy link
Member

detiber commented Dec 30, 2019

/lgtm
/assign @vincepri

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 30, 2019
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 30, 2019
@k8s-ci-robot k8s-ci-robot merged commit 77ed730 into kubernetes-sigs:master Dec 30, 2019
@aaroniscode aaroniscode deleted the eip_events branch January 18, 2020 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Events not generated when Create/Release/Disassociate elastic IP fails
5 participants