From ef0d52eaed8d14118ae95a321d8dde12f8b13102 Mon Sep 17 00:00:00 2001 From: a Date: Fri, 3 Nov 2023 17:28:01 -0500 Subject: [PATCH] fix(storage): handle pathnotfound for walk call --- pkg/storage/imagestore/imagestore.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/storage/imagestore/imagestore.go b/pkg/storage/imagestore/imagestore.go index a388d9cd3f..57a845f73c 100644 --- a/pkg/storage/imagestore/imagestore.go +++ b/pkg/storage/imagestore/imagestore.go @@ -392,6 +392,14 @@ func (is *ImageStore) GetNextRepository(repo string) (string, 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) || (errors.As(err, driverErr) && errors.Is(driverErr.Enclosed, io.EOF)) { return store, nil