Handle new errors returned from catalog repository listing
Signed-off-by: Edgar Lee <edgar.lee@docker.com>
This commit is contained in:
parent
a405d3e88b
commit
8160a430be
1 changed files with 6 additions and 2 deletions
|
@ -6,9 +6,12 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/docker/distribution/registry/api/errcode"
|
"github.com/docker/distribution/registry/api/errcode"
|
||||||
|
"github.com/docker/distribution/registry/storage"
|
||||||
|
"github.com/docker/distribution/registry/storage/driver"
|
||||||
"github.com/gorilla/handlers"
|
"github.com/gorilla/handlers"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -45,9 +48,10 @@ func (ch *catalogHandler) GetCatalog(w http.ResponseWriter, r *http.Request) {
|
||||||
repos := make([]string, maxEntries)
|
repos := make([]string, maxEntries)
|
||||||
|
|
||||||
filled, err := ch.App.registry.Repositories(ch.Context, repos, lastEntry)
|
filled, err := ch.App.registry.Repositories(ch.Context, repos, lastEntry)
|
||||||
if err == io.EOF {
|
|
||||||
|
if err == io.EOF || reflect.TypeOf(err) == reflect.TypeOf(driver.PathNotFoundError{}) {
|
||||||
moreEntries = false
|
moreEntries = false
|
||||||
} else if err != nil {
|
} else if err != nil && err != storage.ErrFinishedWalk {
|
||||||
ch.Errors = append(ch.Errors, errcode.ErrorCodeUnknown.WithDetail(err))
|
ch.Errors = append(ch.Errors, errcode.ErrorCodeUnknown.WithDetail(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue