summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorumohnani8 <umohnani@redhat.com>2017-12-11 10:20:22 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2017-12-14 13:56:20 +0000
commit05f4dd9f41707959ce801f9851c79232a1b79dca (patch)
treeed4cfc80c90204f6166379f4f2c368ac57d480f1 /cmd
parent900afc929f01ef2a38b69263e35c964284f1f9f4 (diff)
downloadpodman-05f4dd9f41707959ce801f9851c79232a1b79dca.tar.gz
podman-05f4dd9f41707959ce801f9851c79232a1b79dca.tar.bz2
podman-05f4dd9f41707959ce801f9851c79232a1b79dca.zip
Clear up fragments of the old api
As everything is being moved over to the new container api removing files that depended on the old api Signed-off-by: umohnani8 <umohnani@redhat.com> Closes: #116 Approved by: rhatdan
Diffstat (limited to 'cmd')
-rw-r--r--cmd/kpod/ps.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/cmd/kpod/ps.go b/cmd/kpod/ps.go
index 36ce18515..4148edf68 100644
--- a/cmd/kpod/ps.go
+++ b/cmd/kpod/ps.go
@@ -15,7 +15,6 @@ import (
"github.com/pkg/errors"
"github.com/projectatomic/libpod/cmd/kpod/formats"
"github.com/projectatomic/libpod/libpod"
- "github.com/projectatomic/libpod/oci"
"github.com/urfave/cli"
"k8s.io/apimachinery/pkg/fields"
)
@@ -491,7 +490,7 @@ func getJSONOutput(containers []*libpod.Container, nSpace bool) ([]psJSONParams,
Names: cc.Name,
Labels: cc.Labels,
Mounts: cc.Spec.Mounts,
- ContainerRunning: conState.String() == oci.ContainerStateRunning,
+ ContainerRunning: conState == libpod.ContainerStateRunning,
Namespaces: ns,
}
psOutput = append(psOutput, params)
@@ -605,7 +604,7 @@ type FilterParamsPS struct {
}
// parseFilter takes a filter string and a list of containers and filters it
-func parseFilter(filter string, containers []*oci.Container) (*FilterParamsPS, error) {
+func parseFilter(filter string, containers []*libpod.Container) (*FilterParamsPS, error) {
params := new(FilterParamsPS)
allFilters := strings.Split(filter, ",")
@@ -630,13 +629,13 @@ func parseFilter(filter string, containers []*oci.Container) (*FilterParamsPS, e
params.ancestor = pair[1]
case "before":
if ctr, err := findContainer(containers, pair[1]); err == nil {
- params.before = ctr.CreatedAt()
+ params.before = ctr.Config().CreatedTime
} else {
return nil, errors.Wrapf(err, "no such container %q", pair[1])
}
case "since":
if ctr, err := findContainer(containers, pair[1]); err == nil {
- params.before = ctr.CreatedAt()
+ params.before = ctr.Config().CreatedTime
} else {
return nil, errors.Wrapf(err, "no such container %q", pair[1])
}
@@ -650,7 +649,7 @@ func parseFilter(filter string, containers []*oci.Container) (*FilterParamsPS, e
}
// findContainer finds a container with a specific name or id from a list of containers
-func findContainer(containers []*oci.Container, ref string) (*oci.Container, error) {
+func findContainer(containers []*libpod.Container, ref string) (*libpod.Container, error) {
for _, ctr := range containers {
if strings.HasPrefix(ctr.ID(), ref) || ctr.Name() == ref {
return ctr, nil