summaryrefslogtreecommitdiff
path: root/libpod/image/image.go
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2018-07-28 04:22:58 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-01 18:22:59 +0000
commit86fb1bf8eb311551626e5877938a7d9d5aee6dac (patch)
tree9d8fe3838166e4658297f6ea62a778bdc60b2539 /libpod/image/image.go
parent90abdfdff52a8b243f96639793ab5a3499fed1ab (diff)
downloadpodman-86fb1bf8eb311551626e5877938a7d9d5aee6dac.tar.gz
podman-86fb1bf8eb311551626e5877938a7d9d5aee6dac.tar.bz2
podman-86fb1bf8eb311551626e5877938a7d9d5aee6dac.zip
Remove an unnecessary use of alltransports.ParseImageName
When the string is formatted including a constant transport name, just call the transport to create or parse a reference explicitly. This avoids unnecessary string formatting and parsing. Then drop image.TarballTransport, which has no remaining users. Should not change behavior (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.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go
index 068e57477..0c070154f 100644
--- a/libpod/image/image.go
+++ b/libpod/image/image.go
@@ -878,8 +878,7 @@ func (i *Image) Inspect(ctx context.Context) (*inspect.ImageData, error) {
// Import imports and image into the store and returns an image
func (ir *Runtime) Import(ctx context.Context, path, reference string, writer io.Writer, signingOptions SigningOptions, imageConfig ociv1.Image) (*Image, error) {
- file := TarballTransport + ":" + path
- src, err := alltransports.ParseImageName(file)
+ src, err := tarball.Transport.ParseReference(path)
if err != nil {
return nil, errors.Wrapf(err, "error parsing image name %q", path)
}