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

Fix aws_ecr_repository data source's most_recent_image_tags attribute #31757

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/31757.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
data/aws_ecr_repository: Correctly set `most_recent_image_tags` when only a single image is found
```
2 changes: 1 addition & 1 deletion internal/service/ecr/repository_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func dataSourceRepositoryRead(ctx context.Context, d *schema.ResourceData, meta
return sdkdiag.AppendErrorf(diags, "reading images for ECR Repository (%s): %s", d.Id(), err)
}

if len(imageDetails) > 1 {
if len(imageDetails) >= 1 {
slices.SortFunc(imageDetails, func(a, b *ecr.ImageDetail) bool {
return aws.TimeValue(a.ImagePushedAt).After(aws.TimeValue(b.ImagePushedAt))
})
Expand Down
Loading