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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issuer/route53: fix delete for 'NotExist' errors #746

Merged
merged 3 commits into from
Jul 20, 2018

Conversation

euank
Copy link
Contributor

@euank euank commented Jul 19, 2018

Fixes #736.

Prior to this change, it was quite possible to end up with a queue of
cleanup tasks that would never succeed.

Release note:

Fixed Route53 cleanup errors for already deleted records.

Fixes cert-manager#736.

Prior to this change, it was quite possible to end up with a queue of
cleanup tasks that would never succeed.
@jetstack-bot jetstack-bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jul 19, 2018
@jetstack-bot jetstack-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 19, 2018
@euank
Copy link
Contributor Author

euank commented Jul 19, 2018

Running ./hack/update-deps.sh isn't providing any diff for me here despite the verify fail.

I'm using:

$ dep version
dep:
 version     : v0.4.1-264-g45be32ba
 build date  : 2018-07-17
 git hash    : 45be32ba
 go version  : go1.10.1
 go compiler : gc
 platform    : linux/amd64
 features    : ImportDuringSolve=false

I ensured I was on a completely clean checkout of this PR.

I assume this is due to a difference in dep version.

@euank euank force-pushed the route53-invalid-change-batch branch from 30275bf to efb339b Compare July 19, 2018 18:25
@munnerz
Copy link
Member

munnerz commented Jul 19, 2018 via email

@jetstack-bot jetstack-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 19, 2018
@euank
Copy link
Contributor Author

euank commented Jul 19, 2018

Reverting dep back to 0.4.1 seems to find the verify issue this was hitting. I find it quite an odd issue though; I'm surprised the input digest changed even though I didn't change "Gopkg.toml" at all.

edit: turns out imports are also an input to the digest function, so e.g. the first reference to the "awserr" package in our code, even though it was already in the vendor folder, changed the digest. My dep didn't catch it because they've since removed the input-digest.

if awserr, ok := err.(awserr.Error); ok {
if action == route53.ChangeActionDelete && awserr.Code() == route53.ErrCodeInvalidChangeBatch {
// If we try to delete something and get a 'InvalidChangeBatch' that
// means it's already deleted, no need to consider it an error.
Copy link
Member

Choose a reason for hiding this comment

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

Looking at the AWS docs, ErrCodeInvalidChangeBatch sounds more like a wrapper type for multiple errors from the AWS API? I think this is still okay given the limited set of operations we perform/errors that could occur, but might it be worth logging the returned error somewhere just in case we get some other weird error responses here and someone needs to open an issue/debug?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think InvalidChangeBatch will be possible for anything else when the transaction is just a single delete (as is the case here), but no harm logging it.

Copy link
Member

Choose a reason for hiding this comment

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

I guess the likes of 503 errors etc are handled with different error response types.

Sounds good to me. I'll lgtm and approve after you've added the log line, if you think it is useful 🙂

@munnerz
Copy link
Member

munnerz commented Jul 20, 2018

/approve

@munnerz
Copy link
Member

munnerz commented Jul 20, 2018

/lgtm

@jetstack-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: munnerz

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

@jetstack-bot jetstack-bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. labels Jul 20, 2018
@jetstack-bot jetstack-bot merged commit b15a18b into cert-manager:master Jul 20, 2018
jetstack-bot added a commit that referenced this pull request Jul 24, 2018
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. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

None yet

3 participants