From 341f91da480bbf337dfb13107389307835b1f0c3 Mon Sep 17 00:00:00 2001 From: baude Date: Tue, 15 Jan 2019 14:31:03 -0600 Subject: Collaberative podman-remote container exists Began frameout of container super structs for adapted methods. This allows for the use of container exists. Signed-off-by: baude --- cmd/podman/exists.go | 8 ++++---- cmd/podman/images.go | 5 +++-- cmd/podman/varlink/io.podman.varlink | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'cmd') diff --git a/cmd/podman/exists.go b/cmd/podman/exists.go index e6d2c8a11..a957e1ef7 100644 --- a/cmd/podman/exists.go +++ b/cmd/podman/exists.go @@ -88,13 +88,13 @@ func containerExistsCmd(c *cli.Context) error { if len(args) > 1 || len(args) < 1 { return errors.New("you may only check for the existence of one container at a time") } - runtime, err := libpodruntime.GetRuntime(c) + runtime, err := adapter.GetRuntime(c) if err != nil { return errors.Wrapf(err, "could not get runtime") } - defer runtime.Shutdown(false) - if _, err := runtime.LookupContainer(args[0]); err != nil { - if errors.Cause(err) == libpod.ErrNoSuchCtr { + defer runtime.Runtime.Shutdown(false) + if _, err := runtime.Runtime.LookupContainer(args[0]); err != nil { + if errors.Cause(err) == libpod.ErrNoSuchCtr || err.Error() == "io.podman.ContainerNotFound" { os.Exit(1) } return err diff --git a/cmd/podman/images.go b/cmd/podman/images.go index 2b4187a9a..7f2fb7ae0 100644 --- a/cmd/podman/images.go +++ b/cmd/podman/images.go @@ -2,14 +2,15 @@ package main import ( "context" - "github.com/containers/libpod/cmd/podman/imagefilters" - "github.com/containers/libpod/libpod/adapter" "reflect" "sort" "strings" "time" "unicode" + "github.com/containers/libpod/cmd/podman/imagefilters" + "github.com/containers/libpod/libpod/adapter" + "github.com/containers/libpod/cmd/podman/formats" "github.com/containers/libpod/libpod/image" "github.com/docker/go-units" diff --git a/cmd/podman/varlink/io.podman.varlink b/cmd/podman/varlink/io.podman.varlink index a3e8c050e..c6f1d3f1b 100644 --- a/cmd/podman/varlink/io.podman.varlink +++ b/cmd/podman/varlink/io.podman.varlink @@ -61,7 +61,7 @@ type ImageSearch ( star_count: int ) -# ListContainer is the returned struct for an individual container +# ListContainerData is the returned struct for an individual container type ListContainerData ( id: string, image: string, -- cgit v1.2.3-54-g00ecf