awslabs / amazon-ecr-credential-helper

Automatically gets credentials for Amazon ECR on docker push/docker pull

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error "duplicate method GetInitialToken"

g-portugues opened this issue · comments

After the last PR submitted, the error "duplicate method GetInitialToken" started to occur.

Command: go get -u github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login

Hmm, I cannot reproduce the issue by doing docker pull [my account ID].dkr.ecr.us-west-2.amazonaws.com/foobar:latest. What have you tried?

Seen in our Jenkins pipeline:

11:20:32  + go get -u github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login
11:20:33  # github.com/awslabs/amazon-ecr-credential-helper/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/aws
11:20:33  /root/go/src/github.com/awslabs/amazon-ecr-credential-helper/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/aws/retryer.go:81:2: duplicate method GetInitialToken

What is your Go version?

There is GetInitialToken() but not sure why that is considered as duplicated.

https://github.com/aws/aws-sdk-go-v2/blob/4148d601ac2aadad64ce670f715b00287f351cb5/aws/retryer.go#L45-L96

1.13

We were able to resolve our issue by updating our container to a version that installed Go 1.18.x:

Old:

image: gradle:7.1.1-jdk11
...
sh "go get -u github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login"

New (go install with @latest, which installs the most recent release):

image: gradle:7-jdk11
...
sh "go install github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login@latest"

We were able to resolve our issue by updating our container to a version that installed Go 1.18.x:

Old:

image: gradle:7.1.1-jdk11
...
sh "go get -u github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login"

New (go install with @latest, which installs the most recent release):

image: gradle:7-jdk11
...
sh "go install github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login@latest"

success! thanks!