-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: Add retry logic to the aws_ecr_repository delete func #9050
Conversation
|
||
return resource.RetryableError( | ||
fmt.Errorf("%q: Timeout while waiting for the ECR Repository to be deleted", d.Id())) | ||
}) |
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.
We don't check the err
from resource.Retry
here, so if the time limit hits we still remove from state, is that correct behavior? If you hit any of the resource.NonRetryableError
paths then we'll still remove from state because we don't check the error
#8597 mentions a possible race condition. The description sounds as if we're attempting to delete this repo before it's actually created. Should we look into polling in the |
Fixes #8597 There was sometimes an issue where Terraform was deleting the ECR repository from the statefile before the reposity was actually deleted. Added retry logic for Terraform to wait for the repository to be deleted before proceeding with the statefile update ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSEcrRepository_' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2016/09/26 12:46:57 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSEcrRepository_ -timeout 120m === RUN TestAccAWSEcrRepository_importBasic --- PASS: TestAccAWSEcrRepository_importBasic (17.86s) === RUN TestAccAWSEcrRepository_basic --- PASS: TestAccAWSEcrRepository_basic (16.40s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 34.288s ```
18cee54
to
15c8534
Compare
The err check looks good; any thoughts on my question here?
|
After discussing with @catsby, we believe we are good with this solution and can merge it now :) |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Fixes #8597
There was sometimes an issue where Terraform was deleting the ECR
repository from the statefile before the reposity was actually deleted.
Added retry logic for Terraform to wait for the repository to be deleted
before proceeding with the statefile update