mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 10:15:35 +01:00
Merge pull request #14677 from bitsf/fix_aws_checkRepository
fix(replication) aws adapter checkRepository
This commit is contained in:
commit
0a67e16922
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user