Merge pull request #14677 from bitsf/fix_aws_checkRepository

fix(replication) aws adapter checkRepository
This commit is contained in:
Steven Zou 2021-04-19 11:16:05 +08:00 committed by GitHub
commit 0a67e16922
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -248,12 +248,14 @@ func (a *adapter) checkRepository(repository string) (exists bool, err error) {
RepositoryNames: []*string{&repository},
})
if err != nil {
if e, ok := err.(awserr.Error); ok {
if e.Code() == awsecrapi.ErrCodeRepositoryNotFoundException {
return false, nil
}
}
return false, err
}
if len(out.Repositories) > 0 {
return true, nil
}
return false, nil
return len(out.Repositories) > 0, nil
}
func (a *adapter) createRepository(repository string) error {