mirror of
https://github.com/distribution/distribution.git
synced 2025-08-21 08:13:39 +00:00
storagedriver/s3: fixed a bug in s3 Walk impl preventing ErrSkipDir from stopping gracefully
This commit is contained in:
parent
aea873cc92
commit
847738fd5e
@ -1122,6 +1122,7 @@ func (d *driver) doWalk(parentCtx context.Context, objectCount *int64, path, pre
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// walk over file's parent directory if not a duplicate
|
||||||
dir := filepath.Dir(walkInfo.Path())
|
dir := filepath.Dir(walkInfo.Path())
|
||||||
if dir != prevDir {
|
if dir != prevDir {
|
||||||
prevDir = dir
|
prevDir = dir
|
||||||
@ -1149,7 +1150,8 @@ func (d *driver) doWalk(parentCtx context.Context, objectCount *int64, path, pre
|
|||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == storagedriver.ErrSkipDir {
|
if err == storagedriver.ErrSkipDir {
|
||||||
break
|
// stop early without return error
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
retError = err
|
retError = err
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user