From b351b12e273cde1f6973420b5aa911c92c51db58 Mon Sep 17 00:00:00 2001 From: baude Date: Sat, 24 Feb 2018 19:52:55 -0600 Subject: Tagging an image alias by shortname When trying to tag an alias (tag) of an image using only the shortname and no tag, we were unable to find the image in storage. This corrects that issue and adds an integration test to protect against regression. I also updated the man page per the filed issue. While writing the integration test, I discovered that inspect could also not find a tagged image without its :tag. Resolves Issue #385 Resolves Issue #384 Signed-off-by: baude Closes: #398 Approved by: mheon --- cmd/podman/inspect.go | 8 ++++++-- cmd/podman/tag.go | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/podman/inspect.go b/cmd/podman/inspect.go index 7820842e8..adb714901 100644 --- a/cmd/podman/inspect.go +++ b/cmd/podman/inspect.go @@ -127,7 +127,9 @@ func iterateInput(c *cli.Context, args []string, runtime *libpod.Runtime, inspec break } case inspectTypeImage: - image, err := runtime.GetImage(input) + newImage := runtime.NewImage(input) + newImage.GetLocalImageName() + image, err := runtime.GetImage(newImage.LocalName) if err != nil { inspectError = errors.Wrapf(err, "error getting image %q", input) break @@ -140,7 +142,9 @@ func iterateInput(c *cli.Context, args []string, runtime *libpod.Runtime, inspec case inspectAll: ctr, err := runtime.LookupContainer(input) if err != nil { - image, err := runtime.GetImage(input) + newImage := runtime.NewImage(input) + newImage.GetLocalImageName() + image, err := runtime.GetImage(newImage.LocalName) if err != nil { inspectError = errors.Wrapf(err, "error getting image %q", input) break diff --git a/cmd/podman/tag.go b/cmd/podman/tag.go index f29c8c182..b71ee97b8 100644 --- a/cmd/podman/tag.go +++ b/cmd/podman/tag.go @@ -30,7 +30,10 @@ func tagCmd(c *cli.Context) error { } defer runtime.Shutdown(false) - img, err := runtime.GetImage(args[0]) + newImage := runtime.NewImage(args[0]) + newImage.GetLocalImageName() + + img, err := runtime.GetImage(newImage.LocalName) if err != nil { return err } -- cgit v1.2.3-54-g00ecf