Description
Describe the bug
So the issue I have encountered is this:
aws ecr describe-images --repository-name my-repo --query "sort_by(imageDetails,& imagePushedAt)[-1]" --no-cli-pager
Output:
{
"registryId": "xxxxxxxxxx",
"repositoryName": "my-repo",
"imageDigest": "sha256:b10aa8e713a0e9bf2e8ed2b9b133fd4a88e8f5f1de4ef68c14691f977bd7c912",
"imageTags": [
"18122024T1715"
],
"imageSizeInBytes": 105261770,
"imagePushedAt": "2024-12-18T18:17:18.998000+01:00",
"imageManifestMediaType": "application/vnd.docker.distribution.manifest.v2+json",
"artifactMediaType": "application/vnd.docker.container.image.v1+json",
"lastRecordedPullTime": "2024-12-18T18:17:20.300000+01:00"
}
aws ecr describe-images --repository-name my-repo --query "sort_by(imageDetails,& imagePushedAt)[-1]" --output text --no-cli-pager
Output:
application/vnd.docker.container.image.v1+json sha256:65cd04e822b8a3e576e90f68a07b7a9ade8eaca40662319a4074208640e17ebc application/vnd.docker.distribution.manifest.v2+json 2024-12-18T18:00:22.553000+01:00 105261604 2024-12-18T18:00:23.862000+01:00 xxxxxxxxxx my-repo
IMAGETAGS 18122024T1658
application/vnd.docker.container.image.v1+json sha256:b10aa8e713a0e9bf2e8ed2b9b133fd4a88e8f5f1de4ef68c14691f977bd7c912 application/vnd.docker.distribution.manifest.v2+json 2024-12-18T18:17:18.998000+01:00 105261770 2024-12-18T18:17:20.300000+01:00 xxxxxxxxxx my-repo
IMAGETAGS 18122024T1715
So the same command with the same query is returning two different responses only for setting the --output flag to text. I am not sure if this is the intended behaviour but I don't really understand the reason.
aws --version
Output:
aws-cli/2.22.14 Python/3.12.6 Darwin/23.6.0 exe/x86_64
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
Return same amount of items and same information when --output test flag is set and when it is not.
Current Behavior
When no --output flag is set, or when is set to json, only one result is appearing. When --output is set to text, two results are appearing.
Reproduction Steps
We haven't encountered this issue ever and we have been using the exact same command for years. Only difference I see now is that the two images where pushed with only 17 minutes apart from each other.
Possible Solution
No response
Additional Information/Context
No response
CLI version used
aws-cli/2.22.14 Python/3.12.6 Darwin/23.6.0 exe/x86_64
Environment details (OS name and version, etc.)
MacOS Sonoma 14.6