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
This commit is contained in:
parent
12ec437605
commit
18bc38d838
@ -900,7 +900,15 @@ func (e *ETCD) listSnapshots(ctx context.Context, snapshotDir string) ([]Snapsho
|
||||
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 {
|
||||
if obj.Err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user