mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 04:05:40 +01:00
fix(replication) aws adapter checkRepository
Signed-off-by: Ziming Zhang <zziming@vmware.com>
This commit is contained in:
parent
fb50b1313e
commit
74bd82b3a1
@ -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