Merge pull request #2484 from restic/add-s3-region

s3: Allow specifying region
This commit is contained in:
rawtaz
2019-11-22 15:51:17 +01:00
committed by GitHub
5 changed files with 21 additions and 7 deletions

View File

@@ -20,8 +20,9 @@ type Config struct {
Layout string `option:"layout" help:"use this backend layout (default: auto-detect)"`
StorageClass string `option:"storage-class" help:"set S3 storage class (STANDARD, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING or REDUCED_REDUNDANCY)"`
Connections uint `option:"connections" help:"set a limit for the number of concurrent connections (default: 5)"`
MaxRetries uint `option:"retries" help:"set the number of retries attempted"`
Connections uint `option:"connections" help:"set a limit for the number of concurrent connections (default: 5)"`
MaxRetries uint `option:"retries" help:"set the number of retries attempted"`
Region string `option:"region" help:"set region"`
}
// NewConfig returns a new Config with the default values filled in.

View File

@@ -66,7 +66,7 @@ func open(cfg Config, rt http.RoundTripper) (*Backend, error) {
},
},
})
client, err := minio.NewWithCredentials(cfg.Endpoint, creds, !cfg.UseHTTP, "")
client, err := minio.NewWithCredentials(cfg.Endpoint, creds, !cfg.UseHTTP, cfg.Region)
if err != nil {
return nil, errors.Wrap(err, "minio.NewWithCredentials")
}