Skip to content

Commit

Permalink
fix(storage): handle pathnotfound for walk call
Browse files Browse the repository at this point in the history
  • Loading branch information
elee1766 committed Nov 6, 2023
1 parent 6a66a9b commit ef0d52e
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
}

Check warning on line 401 in pkg/storage/imagestore/imagestore.go

View check run for this annotation

Codecov / codecov/patch

pkg/storage/imagestore/imagestore.go#L398-L401

Added lines #L398 - L401 were not covered by tests

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 ef0d52e

Please sign in to comment.