Created
July 25, 2018 16:05
-
-
Save legionus/8498f82a55fa0d9e23f44065cc5f207c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/vendor/github.com/docker/distribution/registry/storage/driver/swift/swift.go b/vendor/github.com/docker/distribution/registry/storage/driver/swift/swift.go | |
index 4b7aa4e9f2..27f15bfd25 100644 | |
--- a/vendor/github.com/docker/distribution/registry/storage/driver/swift/swift.go | |
+++ b/vendor/github.com/docker/distribution/registry/storage/driver/swift/swift.go | |
@@ -31,6 +31,7 @@ import ( | |
"strings" | |
"time" | |
+ "github.com/coreos/go-semver/semver" | |
"github.com/mitchellh/mapstructure" | |
"github.com/ncw/swift" | |
@@ -223,7 +224,13 @@ func New(params Parameters) (*Driver, error) { | |
_, d.BulkDeleteSupport = config["bulk_delete"] | |
if err := mapstructure.Decode(config, &info); err == nil { | |
- d.TempURLContainerKey = info.Swift.Version >= "2.3.0" | |
+ featureVersion, featureErr := semver.NewVersion("2.3.0") | |
+ currentVersion, currentErr := semver.NewVersion(info.Swift.Version) | |
+ if featureErr == nil && currentErr == nil { | |
+ d.TempURLContainerKey = !currentVersion.LessThan(*featureVersion) | |
+ } else { | |
+ d.TempURLContainerKey = params.TempURLContainerKey | |
+ } | |
d.TempURLMethods = info.Tempurl.Methods | |
if d.BulkDeleteSupport { | |
d.BulkDeleteMaxDeletes = info.BulkDelete.MaxDeletesPerRequest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment