forked from TrueCloudLab/distribution
Retrieve all the objects using pagination
Signed-off-by: Sylvain Baubeau <sbaubeau@redhat.com>
This commit is contained in:
parent
704e082254
commit
661f197f68
1 changed files with 3 additions and 3 deletions
|
@ -433,7 +433,7 @@ func (d *driver) List(ctx context.Context, path string) ([]string, error) {
|
||||||
Delimiter: '/',
|
Delimiter: '/',
|
||||||
}
|
}
|
||||||
|
|
||||||
objects, err := d.Conn.Objects(d.Container, opts)
|
objects, err := d.Conn.ObjectsAll(d.Container, opts)
|
||||||
for _, obj := range objects {
|
for _, obj := range objects {
|
||||||
files = append(files, strings.TrimPrefix(strings.TrimSuffix(obj.Name, "/"), d.swiftPath("/")))
|
files = append(files, strings.TrimPrefix(strings.TrimSuffix(obj.Name, "/"), d.swiftPath("/")))
|
||||||
}
|
}
|
||||||
|
@ -459,7 +459,7 @@ func (d *driver) Delete(ctx context.Context, path string) error {
|
||||||
Prefix: d.swiftPath(path) + "/",
|
Prefix: d.swiftPath(path) + "/",
|
||||||
}
|
}
|
||||||
|
|
||||||
objects, err := d.Conn.Objects(d.Container, &opts)
|
objects, err := d.Conn.ObjectsAll(d.Container, &opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return parseError(path, err)
|
return parseError(path, err)
|
||||||
}
|
}
|
||||||
|
@ -531,7 +531,7 @@ func (d *driver) getContentType() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *driver) getAllSegments(path string) ([]swift.Object, error) {
|
func (d *driver) getAllSegments(path string) ([]swift.Object, error) {
|
||||||
return d.Conn.Objects(d.Container, &swift.ObjectsOpts{Prefix: d.swiftSegmentPath(path)})
|
return d.Conn.ObjectsAll(d.Container, &swift.ObjectsOpts{Prefix: d.swiftSegmentPath(path)})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *driver) createManifest(path string) (*swift.ObjectCreateFile, error) {
|
func (d *driver) createManifest(path string) (*swift.ObjectCreateFile, error) {
|
||||||
|
|
Loading…
Reference in a new issue