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

--output text flag is giving different results when set #9151

Open
1 task
j0rzsh opened this issue Dec 19, 2024 · 0 comments
Open
1 task

--output text flag is giving different results when set #9151

j0rzsh opened this issue Dec 19, 2024 · 0 comments
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@j0rzsh
Copy link

j0rzsh commented Dec 19, 2024

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

@j0rzsh j0rzsh added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant