diff options
author | Miloslav Trmač <mitr@redhat.com> | 2018-07-28 02:58:56 +0200 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-08-01 18:22:58 +0000 |
commit | 190e0744599e972e4a00ef3a9184cd82c87b5282 (patch) | |
tree | a76cc20becffc754b8b0b1317cc7cdd9ed08a832 /libpod/image/image.go | |
parent | 9770ed257e9ee34dc3506c0f52c9f5f5a66ee57f (diff) | |
download | podman-190e0744599e972e4a00ef3a9184cd82c87b5282.tar.gz podman-190e0744599e972e4a00ef3a9184cd82c87b5282.tar.bz2 podman-190e0744599e972e4a00ef3a9184cd82c87b5282.zip |
Remove the :// end from DockerTransport
(... but keep it in DefaultTransport, which remains irregular.)
This makes DockerTransport consistent with the others, and much more importantly,
allows several instances to do
> imgRef.Transport().Name() == DockerTransport
instead of the current
> strings.HasPrefix(DockerTransport, imgRef.Transport().Name())
, which currently works but is pretty nonsensical (it does not check
the "docker://" prefix against the _full reference_, but it checks
the _transport name_ as a prefix of "docker://", i.e. a transport named
"d" would be accepted.
Should not change behavior, because the only currently existing transport
which has a name that is a prefix of "docker://" is c/image/docker.Transport
(but does not add unit tests).
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Closes: #1176
Approved by: rhatdan
Diffstat (limited to 'libpod/image/image.go')
-rw-r--r-- | libpod/image/image.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go index 112eeb015..914b8f754 100644 --- a/libpod/image/image.go +++ b/libpod/image/image.go @@ -551,7 +551,7 @@ func (i *Image) PushImage(ctx context.Context, destination, manifestMIMEType, au return err } copyOptions := getCopyOptions(writer, signaturePolicyPath, nil, dockerRegistryOptions, signingOptions, authFile, manifestMIMEType, forceCompress, additionalDockerArchiveTags) - if strings.HasPrefix(DockerTransport, dest.Transport().Name()) { + if dest.Transport().Name() == DockerTransport { imgRef, err := reference.Parse(dest.DockerReference().String()) if err != nil { return err |