Merge pull request #872 from ywk253100/161012_sync_repo

Do not show repo which has no tag in it
This commit is contained in:
Daniel Jiang 2016-10-17 15:40:27 +08:00 committed by GitHub
commit 3b02134a5c

View File

@ -373,6 +373,24 @@ func diffRepos(reposInRegistry []string, reposInDB []string) ([]string, []string
needsDel = append(needsDel, repoInD)
j++
} else {
// TODO remove the workaround when the bug of registry is fixed
// TODO read it from config
endpoint := os.Getenv("REGISTRY_URL")
client, err := cache.NewRepositoryClient(endpoint, true,
"admin", repoInR, "repository", repoInR)
if err != nil {
return needsAdd, needsDel, err
}
exist, err := repositoryExist(repoInR, client)
if err != nil {
return needsAdd, needsDel, err
}
if !exist {
needsDel = append(needsDel, repoInD)
}
i++
j++
}