mirror of
https://github.com/containers/podman.git
synced 2025-08-02 01:09:21 +08:00
Don't call image.DecomposeString in imageInListToContainerImage
- 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č <mitr@redhat.com>
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user