浏览代码

Updating docker/distribution vendoring

Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Nishant Totla 8 年之前
父节点
当前提交
d910781c66

+ 1 - 1
vendor.conf

@@ -44,7 +44,7 @@ github.com/boltdb/bolt fff57c100f4dea1905678da7e90d92429dff2904
 github.com/miekg/dns 75e6e86cc601825c5dbcd4e0c209eab180997cd7
 
 # get graph and distribution packages
-github.com/docker/distribution 8016d2d8903e378edacac11e4d809efbc987ad61
+github.com/docker/distribution d22e09a6686c32be8c17b684b639da4b90efe320
 github.com/vbatts/tar-split v0.10.1
 
 # get go-zfs packages

+ 12 - 0
vendor/github.com/docker/distribution/reference/helpers.go

@@ -0,0 +1,12 @@
+package reference
+
+// IsNameOnly returns true if reference only contains a repo name.
+func IsNameOnly(ref Named) bool {
+	if _, ok := ref.(NamedTagged); ok {
+		return false
+	}
+	if _, ok := ref.(Canonical); ok {
+		return false
+	}
+	return true
+}

+ 22 - 0
vendor/github.com/docker/distribution/reference/normalize.go

@@ -0,0 +1,22 @@
+package reference
+
+var (
+	defaultTag = "latest"
+)
+
+// EnsureTagged adds the default tag "latest" to a reference if it only has
+// a repo name.
+func EnsureTagged(ref Named) NamedTagged {
+	namedTagged, ok := ref.(NamedTagged)
+	if !ok {
+		namedTagged, err := WithTag(ref, defaultTag)
+		if err != nil {
+			// Default tag must be valid, to create a NamedTagged
+			// type with non-validated input the WithTag function
+			// should be used instead
+			panic(err)
+		}
+		return namedTagged
+	}
+	return namedTagged
+}