mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-27 19:17:47 +01:00
Fix ecr authorization token issue (#17645)
Signed-off-by: Vincent Ni <kangqini@amazon.com>
This commit is contained in:
parent
b6bdb4b57f
commit
9c0275deb6
@ -127,9 +127,12 @@ func (a *awsAuthCredential) getAuthorization(url string) (string, string, string
|
||||
return "", "", "", nil, err
|
||||
}
|
||||
|
||||
regIds := []*string{&id}
|
||||
var input *awsecrapi.GetAuthorizationTokenInput
|
||||
if id != "" {
|
||||
input = &awsecrapi.GetAuthorizationTokenInput{RegistryIds: []*string{&id}}
|
||||
}
|
||||
svc := a.awssvc
|
||||
result, err := svc.GetAuthorizationToken(&awsecrapi.GetAuthorizationTokenInput{RegistryIds: regIds})
|
||||
result, err := svc.GetAuthorizationToken(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
return "", "", "", nil, fmt.Errorf("%s: %s", aerr.Code(), aerr.Error())
|
||||
|
Loading…
Reference in New Issue
Block a user