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

Add retry mechanism and timeout when reading ecr_repository #3910

Merged
merged 1 commit into from
Oct 9, 2018

Conversation

mildred
Copy link
Contributor

@mildred mildred commented Mar 26, 2018

When creating an ECR repository, creation can be successful but it may
not be available right away through DescribeRepositories API request. We
add a retry mechanism until the repository appears instead of marking
the repository as not existing.

Fixes #3849

Follows #3859 but uses another branch to avoid overriding the master branch of our fork.

@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label Mar 26, 2018
@mildred mildred force-pushed the retry-read-ecr-repository branch from 4c3e44e to 9a60049 Compare March 26, 2018 09:23
@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label Mar 26, 2018
@radeksimko radeksimko added service/ecr Issues and PRs that pertain to the ecr service. enhancement Requests to existing resources that expand the functionality or scope. thinking labels Mar 26, 2018
@bflad
Copy link
Contributor

bflad commented Mar 26, 2018

I noticed this is marked thinking so I'll withhold merging it. For what its worth, acceptance testing passes:

4 tests passed (all tests)
=== RUN   TestAccAWSEcrRepository_basic
--- PASS: TestAccAWSEcrRepository_basic (6.02s)
=== RUN   TestAccAWSEcrRepository_importBasic
--- PASS: TestAccAWSEcrRepository_importBasic (6.76s)
=== RUN   TestAccAWSEcrRepositoryPolicy_basic
--- PASS: TestAccAWSEcrRepositoryPolicy_basic (12.42s)
=== RUN   TestAccAWSEcrRepositoryPolicy_iam
--- PASS: TestAccAWSEcrRepositoryPolicy_iam (21.08s)

When creating an ECR repository, creation can be successful but it may
not be available right away through DescribeRepositories API request. We
add a retry mechanism until the repository appears instead of marking
the repository as not existing.

Fixes hashicorp#3849
@mildred mildred force-pushed the retry-read-ecr-repository branch from 9a60049 to 46b511f Compare July 12, 2018 10:26
@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label Jul 12, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Sorry for the delay merging this 😅 LGTM with one minor adjustment.

--- PASS: TestAccAWSEcrRepository_basic (11.92s)

@@ -22,6 +22,11 @@ func resourceAwsEcrRepository() *schema.Resource {
State: schema.ImportStatePassthrough,
},

Timeouts: &schema.ResourceTimeout{
Read: schema.DefaultTimeout(1 * time.Minute),
Copy link
Contributor

Choose a reason for hiding this comment

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

Our current practice is to hardcode eventual consistency timeouts so will remove this configurable timeout here. If we are changing this practice, we should do so everywhere.

@bflad bflad added this to the v1.40.0 milestone Oct 9, 2018
@bflad bflad merged commit 46b511f into hashicorp:master Oct 9, 2018
bflad added a commit that referenced this pull request Oct 9, 2018
```
--- PASS: TestAccAWSEcrRepository_basic (11.92s)
```
bflad added a commit that referenced this pull request Oct 9, 2018
@bflad
Copy link
Contributor

bflad commented Oct 10, 2018

This has been released in version 1.40.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 2, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ecr Issues and PRs that pertain to the ecr service. size/M Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ECR creation sometimes fails with Resource '...' does not have attribute 'repository_url' for variable '...'
3 participants