mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-02 13:01:23 +01:00
fix #561
This commit is contained in:
parent
4b5098aeba
commit
befc22f3f7
@ -227,13 +227,19 @@ func (ra *RepositoryAPI) GetTags() {
|
|||||||
|
|
||||||
ts, err := rc.ListTag()
|
ts, err := rc.ListTag()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if regErr, ok := err.(*registry_error.Error); ok {
|
regErr, ok := err.(*registry_error.Error)
|
||||||
ra.CustomAbort(regErr.StatusCode, regErr.Detail)
|
if !ok {
|
||||||
}
|
|
||||||
|
|
||||||
log.Errorf("error occurred while listing tags of %s: %v", repoName, err)
|
log.Errorf("error occurred while listing tags of %s: %v", repoName, err)
|
||||||
ra.CustomAbort(http.StatusInternalServerError, "internal error")
|
ra.CustomAbort(http.StatusInternalServerError, "internal error")
|
||||||
}
|
}
|
||||||
|
// TODO remove the logic if the bug of registry is fixed
|
||||||
|
// It's a workaround for a bug of registry: when listing tags of
|
||||||
|
// a repository which is being pushed, a "NAME_UNKNOWN" error will
|
||||||
|
// been returned, while the catalog API can list this repository.
|
||||||
|
if regErr.StatusCode != http.StatusNotFound {
|
||||||
|
ra.CustomAbort(regErr.StatusCode, regErr.Detail)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tags = append(tags, ts...)
|
tags = append(tags, ts...)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user