mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-17 12:21:24 +01:00
bug fix
This commit is contained in:
parent
565110d9f1
commit
1dffe91f91
@ -386,6 +386,29 @@ func diffRepos(reposInRegistry []string, reposInDB []string) ([]string, []string
|
||||
if !exist {
|
||||
continue
|
||||
}
|
||||
|
||||
endpoint, err := config.RegistryURL()
|
||||
if err != nil {
|
||||
log.Errorf("failed to get registry URL: %v", err)
|
||||
continue
|
||||
}
|
||||
client, err := NewRepositoryClient(endpoint, true,
|
||||
"admin", repoInR, "repository", repoInR, "pull")
|
||||
if err != nil {
|
||||
log.Errorf("failed to create repository client: %v", err)
|
||||
continue
|
||||
}
|
||||
|
||||
exist, err = repositoryExist(repoInR, client)
|
||||
if err != nil {
|
||||
log.Errorf("failed to check the existence of repository %s: %v", repoInR, err)
|
||||
continue
|
||||
}
|
||||
|
||||
if !exist {
|
||||
continue
|
||||
}
|
||||
|
||||
needsAdd = append(needsAdd, repoInR)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user