From a6e668fac54b8dcc34b9810738b22fa7c8561325 Mon Sep 17 00:00:00 2001 From: Miloslav Trmač Date: Mon, 14 Jan 2019 03:49:08 +0100 Subject: Don't call image.DecomposeString in imageInListToContainerImage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - It is used to fill Repository(misnamed)/Tag members which have no users; so it's completely unclear why this is useful. - Given the mishandling of tags by imageParts.tag, at the very least all new code should primarily use reference.Named (even if after a decompose() to internally deal with unqualified names first), introducing new uses of original decompose() just reintroduces known trouble - so without any provided rationale, reverting seems a reasonable default action. - This drags in all of libpod/image into the "remote client" build, which seems undesirable. Signed-off-by: Miloslav Trmač --- libpod/adapter/runtime_remote.go | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'libpod/adapter/runtime_remote.go') diff --git a/libpod/adapter/runtime_remote.go b/libpod/adapter/runtime_remote.go index 0fe5c449a..27301d90b 100644 --- a/libpod/adapter/runtime_remote.go +++ b/libpod/adapter/runtime_remote.go @@ -5,13 +5,13 @@ package adapter import ( "context" "fmt" - "github.com/containers/libpod/cmd/podman/varlink" - "github.com/containers/libpod/libpod/image" - "github.com/opencontainers/go-digest" - "github.com/urfave/cli" - "github.com/varlink/go/varlink" "strings" "time" + + iopodman "github.com/containers/libpod/cmd/podman/varlink" + digest "github.com/opencontainers/go-digest" + "github.com/urfave/cli" + "github.com/varlink/go/varlink" ) // ImageRuntime is wrapper for image runtime @@ -59,8 +59,6 @@ type remoteImage struct { RepoDigests []string Parent string Size int64 - Tag string - Repository string Created time.Time InputName string Names []string @@ -91,10 +89,6 @@ func (r *LocalRuntime) GetImages() ([]*ContainerImage, error) { } func imageInListToContainerImage(i iopodman.ImageInList, name string, runtime *LocalRuntime) (*ContainerImage, error) { - imageParts, err := image.DecomposeString(name) - if err != nil { - return nil, err - } created, err := splitStringDate(i.Created) if err != nil { return nil, err @@ -108,8 +102,6 @@ func imageInListToContainerImage(i iopodman.ImageInList, name string, runtime *L Parent: i.ParentId, Size: i.Size, Created: created, - Tag: imageParts.Tag, - Repository: imageParts.Registry, Names: i.RepoTags, isParent: i.IsParent, Runtime: runtime, -- cgit v1.2.3-54-g00ecf