Skip to content

Commit

Permalink
fix(storage): handle pathnotfound for walk call (#2006)
Browse files Browse the repository at this point in the history
Signed-off-by: a <[email protected]>
  • Loading branch information
elee1766 authored Nov 7, 2023
1 parent d506551 commit ff16e4c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/storage/imagestore/imagestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ff16e4c

Please sign in to comment.