mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-23 09:08:26 +01:00
do not show repo which has no tag in it
This commit is contained in:
parent
d8f2723406
commit
44ecac0b4a
18
api/utils.go
18
api/utils.go
@ -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++
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user