From e6f8d7c28e672168b47dc19128f6e37680e7e345 Mon Sep 17 00:00:00 2001 From: Nikita Date: Wed, 13 Apr 2016 19:32:10 +0400 Subject: [PATCH 1/5] Update swift.go Signed-off-by: Nikita Tarasov --- registry/storage/driver/swift/swift.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/registry/storage/driver/swift/swift.go b/registry/storage/driver/swift/swift.go index 91384828..4c115030 100644 --- a/registry/storage/driver/swift/swift.go +++ b/registry/storage/driver/swift/swift.go @@ -69,6 +69,7 @@ type Parameters struct { DomainID string TrustID string Region string + AuthVersion int Container string Prefix string InsecureSkipVerify bool @@ -174,6 +175,7 @@ func New(params Parameters) (*Driver, error) { ApiKey: params.Password, AuthUrl: params.AuthURL, Region: params.Region, + AuthVersion: params.AuthVersion, UserAgent: "distribution/" + version.Version, Tenant: params.Tenant, TenantId: params.TenantID, From bcb7989fca4b65cae10f3d553b4a3cf633b4477d Mon Sep 17 00:00:00 2001 From: Nikita Date: Wed, 13 Apr 2016 19:37:45 +0400 Subject: [PATCH 2/5] test Signed-off-by: Nikita Tarasov --- registry/storage/driver/swift/swift_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/registry/storage/driver/swift/swift_test.go b/registry/storage/driver/swift/swift_test.go index b2ff6001..bffd54e8 100644 --- a/registry/storage/driver/swift/swift_test.go +++ b/registry/storage/driver/swift/swift_test.go @@ -33,6 +33,7 @@ func init() { trustID string container string region string + AuthVersion int insecureSkipVerify bool secretKey string accessKey string @@ -52,6 +53,7 @@ func init() { trustID = os.Getenv("SWIFT_TRUST_ID") container = os.Getenv("SWIFT_CONTAINER_NAME") region = os.Getenv("SWIFT_REGION_NAME") + AuthVersion = os.Getenv("SWIFT_AUTH_VERSION") insecureSkipVerify, _ = strconv.ParseBool(os.Getenv("SWIFT_INSECURESKIPVERIFY")) secretKey = os.Getenv("SWIFT_SECRET_KEY") accessKey = os.Getenv("SWIFT_ACCESS_KEY") @@ -85,6 +87,7 @@ func init() { domainID, trustID, region, + AuthVersion, container, root, insecureSkipVerify, From b51607f9f01576fa9cc4821ee7fb3f40171f1d64 Mon Sep 17 00:00:00 2001 From: Nikita Tarasov Date: Wed, 13 Apr 2016 19:06:33 +0300 Subject: [PATCH 3/5] fix test Signed-off-by: Nikita Tarasov Signed-off-by: Nikita Tarasov --- registry/storage/driver/swift/swift_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/storage/driver/swift/swift_test.go b/registry/storage/driver/swift/swift_test.go index bffd54e8..b4f1c738 100644 --- a/registry/storage/driver/swift/swift_test.go +++ b/registry/storage/driver/swift/swift_test.go @@ -53,7 +53,7 @@ func init() { trustID = os.Getenv("SWIFT_TRUST_ID") container = os.Getenv("SWIFT_CONTAINER_NAME") region = os.Getenv("SWIFT_REGION_NAME") - AuthVersion = os.Getenv("SWIFT_AUTH_VERSION") + AuthVersion = strconv.Atoi(os.Getenv("SWIFT_AUTH_VERSION")) insecureSkipVerify, _ = strconv.ParseBool(os.Getenv("SWIFT_INSECURESKIPVERIFY")) secretKey = os.Getenv("SWIFT_SECRET_KEY") accessKey = os.Getenv("SWIFT_ACCESS_KEY") From b4f060599ad885aad25dcf94b04dba4673b49143 Mon Sep 17 00:00:00 2001 From: Nikita Tarasov Date: Sun, 17 Apr 2016 20:05:51 +0300 Subject: [PATCH 4/5] docs + fix test Signed-off-by: Nikita Tarasov --- docs/storage-drivers/swift.md | 10 ++++++++++ registry/storage/driver/swift/swift_test.go | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/storage-drivers/swift.md b/docs/storage-drivers/swift.md index cab0bbd2..28e87d4d 100644 --- a/docs/storage-drivers/swift.md +++ b/docs/storage-drivers/swift.md @@ -298,6 +298,16 @@ An implementation of the `storagedriver.StorageDriver` interface that uses [Open

+ + + authversion + + +

+ Optionally, specify the OpenStack Auth's version,for example 3. The driver use 0 (autodetect) by default. +

+ + chunksize diff --git a/registry/storage/driver/swift/swift_test.go b/registry/storage/driver/swift/swift_test.go index b4f1c738..655aa996 100644 --- a/registry/storage/driver/swift/swift_test.go +++ b/registry/storage/driver/swift/swift_test.go @@ -53,7 +53,7 @@ func init() { trustID = os.Getenv("SWIFT_TRUST_ID") container = os.Getenv("SWIFT_CONTAINER_NAME") region = os.Getenv("SWIFT_REGION_NAME") - AuthVersion = strconv.Atoi(os.Getenv("SWIFT_AUTH_VERSION")) + AuthVersion, _ = strconv.Atoi(os.Getenv("SWIFT_AUTH_VERSION")) insecureSkipVerify, _ = strconv.ParseBool(os.Getenv("SWIFT_INSECURESKIPVERIFY")) secretKey = os.Getenv("SWIFT_SECRET_KEY") accessKey = os.Getenv("SWIFT_ACCESS_KEY") From f18da7d3a3f5343b3742302fe59fcc8cbd696a42 Mon Sep 17 00:00:00 2001 From: Nikita Tarasov Date: Mon, 16 May 2016 16:09:26 +0300 Subject: [PATCH 5/5] update docs Signed-off-by: Nikita Tarasov --- docs/storage-drivers/swift.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/storage-drivers/swift.md b/docs/storage-drivers/swift.md index 28e87d4d..4e28847d 100644 --- a/docs/storage-drivers/swift.md +++ b/docs/storage-drivers/swift.md @@ -304,7 +304,7 @@ An implementation of the `storagedriver.StorageDriver` interface that uses [Open

- Optionally, specify the OpenStack Auth's version,for example 3. The driver use 0 (autodetect) by default. + Optionally, specify the OpenStack Auth's version,for example 3. By default the driver will autodetect the auth's version from the AuthURL.