0
Fork 0
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:
a 2023-11-07 03:47:12 -06:00 committed by GitHub
parent d5065513f5
commit ff16e4c3db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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