mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-05 21:14:56 +00:00
AWS: Ensure that the order returned by ListObjects is consistent
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
This commit is contained in:
@@ -18,6 +18,7 @@ package aws
|
||||
|
||||
import (
|
||||
"io"
|
||||
"sort"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
@@ -181,6 +182,11 @@ func (o *objectStore) ListObjects(bucket, prefix string) ([]string, error) {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
|
||||
// ensure that returned objects are in a consistent order so that the deletion logic deletes the objects before
|
||||
// the pseudo-folder prefix object for s3 providers (such as Quobyte) that return the pseudo-folder as an object.
|
||||
// See https://github.com/heptio/ark/pull/999
|
||||
sort.Sort(sort.Reverse(sort.StringSlice(ret)))
|
||||
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user