do not show repo which has no tag in it

This commit is contained in:
Wenkai Yin 2016-10-12 17:35:50 +08:00
parent d8f2723406
commit 44ecac0b4a

View File

@ -373,6 +373,24 @@ func diffRepos(reposInRegistry []string, reposInDB []string) ([]string, []string
needsDel = append(needsDel, repoInD) needsDel = append(needsDel, repoInD)
j++ j++
} else { } 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++ i++
j++ j++
} }