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

Closed
1 task
j0rzsh opened this issue Dec 19, 2024 · 3 comments
Closed
1 task

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

j0rzsh opened this issue Dec 19, 2024 · 3 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
@jack-parsons-bjss
Copy link

This looks like it might be a duplicate of this issue I raised a short while ago: #8998
Despite the documentation, it feels like misleading behaviour.

@j0rzsh
Copy link
Author

j0rzsh commented Dec 23, 2024

Hmm that looks like the same cause, yes. Many thanks for bringing that up I didnt saw it.

I would also add some bit of information after more testing we did. This only is appearing in the ECR repository in which we are using the docker labels in the images. This is a new development we are doing but we didn't think that should change that awscli response 🤔

We ended up doing the same as I can see now in your issue, in this comment.

Many thanks, I will close the issue because as I can see it is not intended to be changed, even though it is pretty confusing behaviour.

@j0rzsh j0rzsh closed this as completed Dec 23, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

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

2 participants