This commit is contained in:
Wenkai Yin 2017-05-26 17:23:01 +08:00
parent 565110d9f1
commit 1dffe91f91

View File

@ -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)
}