mirror of
https://github.com/octoleo/restic.git
synced 2024-12-23 03:18:55 +00:00
Fix code for newer minio-go
This commit is contained in:
parent
e893be3dec
commit
06b23edb39
@ -35,12 +35,15 @@ func Open(cfg Config) (backend.Backend, error) {
|
||||
be := &s3{client: client, bucketname: cfg.Bucket, prefix: cfg.Prefix}
|
||||
be.createConnections()
|
||||
|
||||
if err := client.BucketExists(cfg.Bucket); err != nil {
|
||||
ok, err := client.BucketExists(cfg.Bucket)
|
||||
if err != nil {
|
||||
debug.Log("s3.Open", "BucketExists(%v) returned err %v, trying to create the bucket", cfg.Bucket, err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !ok {
|
||||
// create new bucket with default ACL in default region
|
||||
err = client.MakeBucket(cfg.Bucket, "")
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user