Consolidate the s3 driver parameters with a struct
This commit is contained in:
parent
7c9112fc3c
commit
bc9509d85f
2 changed files with 48 additions and 12 deletions
|
@ -28,9 +28,10 @@ func init() {
|
|||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer os.Remove(root)
|
||||
|
||||
s3DriverConstructor := func(region aws.Region) (storagedriver.StorageDriver, error) {
|
||||
encryptBool := true
|
||||
encryptBool := false
|
||||
if encrypt != "" {
|
||||
encryptBool, err = strconv.ParseBool(encrypt)
|
||||
if err != nil {
|
||||
|
@ -53,7 +54,19 @@ func init() {
|
|||
return nil, err
|
||||
}
|
||||
}
|
||||
return New(accessKey, secretKey, bucket, root, region, encryptBool, secureBool, v4AuthBool)
|
||||
|
||||
parameters := DriverParameters{
|
||||
accessKey,
|
||||
secretKey,
|
||||
bucket,
|
||||
region,
|
||||
encryptBool,
|
||||
secureBool,
|
||||
v4AuthBool,
|
||||
root,
|
||||
}
|
||||
|
||||
return New(parameters)
|
||||
}
|
||||
|
||||
// Skip S3 storage driver tests if environment variable parameters are not provided
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue