mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
account for an s3 folder when listing objects (#3807)
* account for an s3 folder when listing objects
This commit is contained in:
parent
b4eca61aeb
commit
dcf0657b20
@ -904,7 +904,15 @@ func (e *ETCD) listSnapshots(ctx context.Context, snapshotDir string) ([]Snapsho
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
objects := e.s3.client.ListObjects(ctx, e.config.EtcdS3BucketName, minio.ListObjectsOptions{})
|
var loo minio.ListObjectsOptions
|
||||||
|
if e.config.EtcdS3Folder != "" {
|
||||||
|
loo = minio.ListObjectsOptions{
|
||||||
|
Prefix: e.config.EtcdS3Folder,
|
||||||
|
Recursive: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
objects := e.s3.client.ListObjects(ctx, e.config.EtcdS3BucketName, loo)
|
||||||
|
|
||||||
for obj := range objects {
|
for obj := range objects {
|
||||||
if obj.Err != nil {
|
if obj.Err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user