diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-12-01 14:40:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-01 14:40:18 +0100 |
commit | 24383906f891cea0c802f911deed43f8f8f2ac85 (patch) | |
tree | ed5d88792a902c311374241ae80256d5b1bf7d37 /pkg/domain | |
parent | 9ae12f84e8d4704fe4c303fdedb12be8e4e73f59 (diff) | |
parent | 2d861ac14ad5b677717f357bd57c3f56f06307d5 (diff) | |
download | podman-24383906f891cea0c802f911deed43f8f8f2ac85.tar.gz podman-24383906f891cea0c802f911deed43f8f8f2ac85.tar.bz2 podman-24383906f891cea0c802f911deed43f8f8f2ac85.zip |
Merge pull request #8427 from rhatdan/ps
Handle ps container created field as a time.Time
Diffstat (limited to 'pkg/domain')
-rw-r--r-- | pkg/domain/entities/container_ps.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/domain/entities/container_ps.go b/pkg/domain/entities/container_ps.go index ed40a37ab..b4e8446cb 100644 --- a/pkg/domain/entities/container_ps.go +++ b/pkg/domain/entities/container_ps.go @@ -3,6 +3,7 @@ package entities import ( "sort" "strings" + "time" "github.com/containers/podman/v2/pkg/ps/define" "github.com/cri-o/ocicni/pkg/ocicni" @@ -14,7 +15,7 @@ type ListContainer struct { // Container command Command []string // Container creation time - Created int64 + Created time.Time // Human readable container creation time. CreatedAt string // If container has exited/stopped @@ -137,7 +138,7 @@ func (a psSortedSize) Less(i, j int) bool { type PsSortedCreateTime struct{ SortListContainers } func (a PsSortedCreateTime) Less(i, j int) bool { - return a.SortListContainers[i].Created < a.SortListContainers[j].Created + return a.SortListContainers[i].Created.Before(a.SortListContainers[j].Created) } func SortPsOutput(sortBy string, psOutput SortListContainers) (SortListContainers, error) { |