mirror of
https://github.com/project-zot/zot.git
synced 2024-12-16 21:56:37 -05:00
fix(storage): handle pathnotfound for walk call (#2006)
Signed-off-by: a <a@tuxpa.in>
This commit is contained in:
parent
d5065513f5
commit
ff16e4c3db
1 changed files with 8 additions and 0 deletions
|
@ -392,6 +392,14 @@ func (is *ImageStore) GetNextRepository(repo string) (string, error) {
|
||||||
|
|
||||||
driverErr := &driver.Error{}
|
driverErr := &driver.Error{}
|
||||||
|
|
||||||
|
// some s3 implementations (eg, digitalocean spaces) will return pathnotfounderror for walk but not list
|
||||||
|
// therefore, we must also catch that error here.
|
||||||
|
if errors.As(err, &driver.PathNotFoundError{}) {
|
||||||
|
is.log.Debug().Msg("empty rootDir")
|
||||||
|
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
|
||||||
if errors.Is(err, io.EOF) ||
|
if errors.Is(err, io.EOF) ||
|
||||||
(errors.As(err, driverErr) && errors.Is(driverErr.Enclosed, io.EOF)) {
|
(errors.As(err, driverErr) && errors.Is(driverErr.Enclosed, io.EOF)) {
|
||||||
return store, nil
|
return store, nil
|
||||||
|
|
Loading…
Reference in a new issue