mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 04:05:40 +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},
|
RepositoryNames: []*string{&repository},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if e, ok := err.(awserr.Error); ok {
|
||||||
|
if e.Code() == awsecrapi.ErrCodeRepositoryNotFoundException {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
if len(out.Repositories) > 0 {
|
return len(out.Repositories) > 0, nil
|
||||||
return true, nil
|
|
||||||
}
|
|
||||||
return false, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *adapter) createRepository(repository string) error {
|
func (a *adapter) createRepository(repository string) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user