57 lines
1.4 KiB
Diff
57 lines
1.4 KiB
Diff
https://github.com/estesp/manifest-tool/issues/47
|
|
|
|
diff --git a/vendor/github.com/docker/distribution/reference/reference.go b/vendor/github.com/docker/distribution/reference/reference.go
|
|
index 52da523..3cf3d98 100644
|
|
--- a/vendor/github.com/docker/distribution/reference/reference.go
|
|
+++ b/vendor/github.com/docker/distribution/reference/reference.go
|
|
@@ -100,6 +100,13 @@ func (f *Field) UnmarshalText(p []byte) error {
|
|
return nil
|
|
}
|
|
|
|
+func remoteName(name string) string {
|
|
+ if !strings.ContainsRune(name, '/') {
|
|
+ return "library/" + name
|
|
+ }
|
|
+ return name
|
|
+}
|
|
+
|
|
// Named is an object with a full name
|
|
type Named interface {
|
|
Reference
|
|
@@ -304,7 +311,7 @@ func (r reference) String() string {
|
|
}
|
|
|
|
func (r reference) Name() string {
|
|
- return r.name
|
|
+ return remoteName(r.name)
|
|
}
|
|
|
|
func (r reference) Tag() string {
|
|
@@ -322,7 +329,7 @@ func (r repository) String() string {
|
|
}
|
|
|
|
func (r repository) Name() string {
|
|
- return string(r)
|
|
+ return remoteName(string(r))
|
|
}
|
|
|
|
type digestReference digest.Digest
|
|
@@ -345,7 +352,7 @@ func (t taggedReference) String() string {
|
|
}
|
|
|
|
func (t taggedReference) Name() string {
|
|
- return t.name
|
|
+ return remoteName(t.name)
|
|
}
|
|
|
|
func (t taggedReference) Tag() string {
|
|
@@ -362,7 +369,7 @@ func (c canonicalReference) String() string {
|
|
}
|
|
|
|
func (c canonicalReference) Name() string {
|
|
- return c.name
|
|
+ return remoteName(c.name)
|
|
}
|
|
|
|
func (c canonicalReference) Digest() digest.Digest {
|