Closed volphy closed 4 months ago
Is it a duplicate of: https://github.com/awslabs/amazon-ecr-credential-helper/issues/797 ?
Hi @volphy thanks for submitting the issue. Here is my initial triage of the issue.
I have confirmed this issue is a duplicate of #432, resolved by #635, and will be included in the 0.8.0 release. You can follow #798 for updates on the release.
As a workaround, users can can do ./docker-credential-ecr-login -v
which prints the correct version for the <0.8.0 releases.
I reproduced the issue by downloading the v0.7.1 credential helper artifact from S3.
localhost:~$ ./docker-credential-ecr-login version
(github.com/docker/docker-credential-helpers) v0.0.0+unknown
localhost:~$ ./docker-credential-ecr-login -v
amazon-ecr-credential-helper
Version: 0.7.1
Git commit: adf1bafd791ae7d4ff098108b1e91f36a4da5404
localhost:~$
The confusion I had was the ECR credential helper does not create a version
flag in its main function. Version information is reported via -v
flag.
https://github.com/awslabs/amazon-ecr-credential-helper/blob/b99368f3064d606193d46aa0fd72437b2b28de5a/ecr-login/cli/docker-credential-ecr-login/main.go#L42
After some investigation I found #635 which showed the version
command is added by github.com/docker/docker-credential-helpers and fixed the issue for the version information to show correct with version
command.
https://github.com/docker/docker-credential-helpers/blob/6b9df3ebb5da5aa22f722b25506bba1414519c6a/credentials/credentials.go#L24
Lastly, I confirmed the issue is resolved in the next release (0.8.0) by building a local artifact from github.com/awslabs/amazon-ecr-credential-helper/blob/staging and validating the version
command is working correctly.
[amazon-ecr-credential-helper]$ ./bin/local/docker-credential-ecr-login version
docker-credential-ecr-login (github.com/awslabs/amazon-ecr-credential-helper/ecr-login) 0.8.0
[amazon-ecr-credential-helper]$ ./bin/local/docker-credential-ecr-login -v
amazon-ecr-credential-helper
Version: 0.8.0
Git commit: 388a708
[amazon-ecr-credential-helper]$
Unless there are any objections, I recommend to keep this issue open until the release is complete so the fix can be verified before closing.
Verified the issue is resolved with the 0.8.0 release. https://github.com/awslabs/amazon-ecr-credential-helper/releases/tag/v0.8.0
[~]$ ./docker-credential-ecr-login version
docker-credential-ecr-login (github.com/awslabs/amazon-ecr-credential-helper/ecr-login) 0.8.0
[~]$ ./docker-credential-ecr-login -v
amazon-ecr-credential-helper
Version: 0.8.0
Git commit: 388a708931c25b953eb88e6a40f4ef67cd0278fe
Tested on the following static binaries: https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/0.7.1/darwin-amd64/docker-credential-ecr-login https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/0.7.1/linux-amd64/docker-credential-ecr-login
In both cases, version number is reported incorrectly: