-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
ECR - Add ability to query by and return most recent image tag(s) #26857
Conversation
Community NoteVoting for Prioritization
For Submitters
|
This reverts commit d08ce29.
This reverts commit 732cbcc.
…ata source" This reverts commit c2235bc.
…rce" This reverts commit 3c56d2f.
Acceptance test output: % make testacc TESTARGS='-run=TestAccECRImageDataSource_basic' PKG=ecr ACCTEST_PARALLELISM=3 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/ecr/... -v -count 1 -parallel 3 -run=TestAccECRImageDataSource_basic -timeout 180m === RUN TestAccECRImageDataSource_basic === PAUSE TestAccECRImageDataSource_basic === CONT TestAccECRImageDataSource_basic --- PASS: TestAccECRImageDataSource_basic (14.72s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/ecr 20.070s
Acceptance test output: % make testacc TESTARGS='-run=TestAccECRImageDataSource_basic' PKG=ecr ACCTEST_PARALLELISM=3 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/ecr/... -v -count 1 -parallel 3 -run=TestAccECRImageDataSource_basic -timeout 180m === RUN TestAccECRImageDataSource_basic === PAUSE TestAccECRImageDataSource_basic === CONT TestAccECRImageDataSource_basic --- PASS: TestAccECRImageDataSource_basic (18.37s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/ecr 23.594s
Acceptance test output: % make testacc TESTARGS='-run=TestAccECRRepositoryDataSource_' PKG=ecr ACCTEST_PARALLELISM=3 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/ecr/... -v -count 1 -parallel 3 -run=TestAccECRRepositoryDataSource_ -timeout 180m === RUN TestAccECRRepositoryDataSource_basic === PAUSE TestAccECRRepositoryDataSource_basic === RUN TestAccECRRepositoryDataSource_encryption === PAUSE TestAccECRRepositoryDataSource_encryption === RUN TestAccECRRepositoryDataSource_nonExistent === PAUSE TestAccECRRepositoryDataSource_nonExistent === CONT TestAccECRRepositoryDataSource_basic === CONT TestAccECRRepositoryDataSource_nonExistent === CONT TestAccECRRepositoryDataSource_encryption --- PASS: TestAccECRRepositoryDataSource_nonExistent (3.81s) --- PASS: TestAccECRRepositoryDataSource_basic (16.31s) --- PASS: TestAccECRRepositoryDataSource_encryption (18.35s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/ecr 23.452s
Acceptance test output: % make testacc TESTARGS='-run=TestAccECRRepository_' PKG=ecr ACCTEST_PARALLELISM=3 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/ecr/... -v -count 1 -parallel 3 -run=TestAccECRRepository_ -timeout 180m === RUN TestAccECRRepository_basic === PAUSE TestAccECRRepository_basic === RUN TestAccECRRepository_disappears === PAUSE TestAccECRRepository_disappears === RUN TestAccECRRepository_tags === PAUSE TestAccECRRepository_tags === RUN TestAccECRRepository_immutability === PAUSE TestAccECRRepository_immutability === RUN TestAccECRRepository_Image_scanning === PAUSE TestAccECRRepository_Image_scanning === RUN TestAccECRRepository_Encryption_kms === PAUSE TestAccECRRepository_Encryption_kms === RUN TestAccECRRepository_Encryption_aes256 === PAUSE TestAccECRRepository_Encryption_aes256 === CONT TestAccECRRepository_basic === CONT TestAccECRRepository_Encryption_aes256 === CONT TestAccECRRepository_immutability --- PASS: TestAccECRRepository_immutability (20.48s) === CONT TestAccECRRepository_Encryption_kms --- PASS: TestAccECRRepository_basic (20.67s) === CONT TestAccECRRepository_tags --- PASS: TestAccECRRepository_Encryption_aes256 (38.39s) === CONT TestAccECRRepository_Image_scanning --- PASS: TestAccECRRepository_Encryption_kms (35.21s) === CONT TestAccECRRepository_disappears --- PASS: TestAccECRRepository_tags (41.06s) --- PASS: TestAccECRRepository_disappears (12.06s) --- PASS: TestAccECRRepository_Image_scanning (42.06s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/ecr 85.790s
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.
LGTM 🚀.
% make testacc TESTARGS='-run=TestAccECRRepository_' PKG=ecr ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ecr/... -v -count 1 -parallel 3 -run=TestAccECRRepository_ -timeout 180m
=== RUN TestAccECRRepository_basic
=== PAUSE TestAccECRRepository_basic
=== RUN TestAccECRRepository_disappears
=== PAUSE TestAccECRRepository_disappears
=== RUN TestAccECRRepository_tags
=== PAUSE TestAccECRRepository_tags
=== RUN TestAccECRRepository_immutability
=== PAUSE TestAccECRRepository_immutability
=== RUN TestAccECRRepository_Image_scanning
=== PAUSE TestAccECRRepository_Image_scanning
=== RUN TestAccECRRepository_Encryption_kms
=== PAUSE TestAccECRRepository_Encryption_kms
=== RUN TestAccECRRepository_Encryption_aes256
=== PAUSE TestAccECRRepository_Encryption_aes256
=== CONT TestAccECRRepository_basic
=== CONT TestAccECRRepository_Encryption_aes256
=== CONT TestAccECRRepository_immutability
--- PASS: TestAccECRRepository_immutability (20.48s)
=== CONT TestAccECRRepository_Encryption_kms
--- PASS: TestAccECRRepository_basic (20.67s)
=== CONT TestAccECRRepository_tags
--- PASS: TestAccECRRepository_Encryption_aes256 (38.39s)
=== CONT TestAccECRRepository_Image_scanning
--- PASS: TestAccECRRepository_Encryption_kms (35.21s)
=== CONT TestAccECRRepository_disappears
--- PASS: TestAccECRRepository_tags (41.06s)
--- PASS: TestAccECRRepository_disappears (12.06s)
--- PASS: TestAccECRRepository_Image_scanning (42.06s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ecr 85.790s
% make testacc TESTARGS='-run=TestAccECRRepositoryDataSource_' PKG=ecr ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ecr/... -v -count 1 -parallel 3 -run=TestAccECRRepositoryDataSource_ -timeout 180m
=== RUN TestAccECRRepositoryDataSource_basic
=== PAUSE TestAccECRRepositoryDataSource_basic
=== RUN TestAccECRRepositoryDataSource_encryption
=== PAUSE TestAccECRRepositoryDataSource_encryption
=== RUN TestAccECRRepositoryDataSource_nonExistent
=== PAUSE TestAccECRRepositoryDataSource_nonExistent
=== CONT TestAccECRRepositoryDataSource_basic
=== CONT TestAccECRRepositoryDataSource_nonExistent
=== CONT TestAccECRRepositoryDataSource_encryption
--- PASS: TestAccECRRepositoryDataSource_nonExistent (3.81s)
--- PASS: TestAccECRRepositoryDataSource_basic (16.31s)
--- PASS: TestAccECRRepositoryDataSource_encryption (18.35s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ecr 23.452s
% make testacc TESTARGS='-run=TestAccECRImageDataSource_basic' PKG=ecr ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ecr/... -v -count 1 -parallel 3 -run=TestAccECRImageDataSource_basic -timeout 180m
=== RUN TestAccECRImageDataSource_basic
=== PAUSE TestAccECRImageDataSource_basic
=== CONT TestAccECRImageDataSource_basic
--- PASS: TestAccECRImageDataSource_basic (18.37s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ecr 23.594s
@mtt88 Thanks for the contribution 🎉 👏. |
This functionality has been released in v4.56.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Add
most_recent
attribute to data sourceaws_ecr_image
which will return the most recently pushed tag(s) for an ecr image.Add
most_recent_image_tags
to data sourceaws_ecr_repository
which will return the most recently pushed tag(s) for an ecr repository.Questions:
How best to add tests for this new functionality? I've extended the existing tests in a limited way to check the existence of these new attributes but I am unsure how best to test that they are correct?
Do we want to add
most_recent_image_tags
to theaws_ecr_repository
resource in addition to the data source?Closes #12798.
Closes #26658.
Output from acceptance testing: