mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-23 00:57:44 +01:00
Merge pull request #872 from ywk253100/161012_sync_repo
Do not show repo which has no tag in it
This commit is contained in:
commit
3b02134a5c
18
api/utils.go
18
api/utils.go
@ -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++
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user