diff options
author | Brent Baude <bbaude@redhat.com> | 2020-04-17 11:01:45 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-04-17 13:22:06 -0500 |
commit | 44a8cf867665927111fe9ea03711c8fabfc7d4a2 (patch) | |
tree | cac0714b1d0e4ae4636c03191f4752235dd1a38d /cmd/podman/images | |
parent | d68b028c9440cd3f952327b05f1bc8dee00ab98a (diff) | |
download | podman-44a8cf867665927111fe9ea03711c8fabfc7d4a2.tar.gz podman-44a8cf867665927111fe9ea03711c8fabfc7d4a2.tar.bz2 podman-44a8cf867665927111fe9ea03711c8fabfc7d4a2.zip |
Fixes for system tests
Various fixes to protect against regressions in system tests
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/images')
-rw-r--r-- | cmd/podman/images/list.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cmd/podman/images/list.go b/cmd/podman/images/list.go index 366dfc4ba..63ddc5d56 100644 --- a/cmd/podman/images/list.go +++ b/cmd/podman/images/list.go @@ -112,14 +112,16 @@ func images(cmd *cobra.Command, args []string) error { func writeJSON(imageS []*entities.ImageSummary) error { type image struct { entities.ImageSummary - Created string + Created string + CreatedAt string } imgs := make([]image, 0, len(imageS)) for _, e := range imageS { var h image h.ImageSummary = *e - h.Created = time.Unix(e.Created, 0).Format(time.RFC3339) + h.Created = units.HumanDuration(time.Since(e.Created)) + " ago" + h.CreatedAt = e.Created.Format(time.RFC3339Nano) h.RepoTags = nil imgs = append(imgs, h) @@ -196,7 +198,7 @@ func sortFunc(key string, data []*entities.ImageSummary) func(i, j int) bool { default: // case "created": return func(i, j int) bool { - return data[i].Created >= data[j].Created + return data[i].Created.After(data[j].Created) } } } @@ -255,11 +257,11 @@ func (i imageReporter) ID() string { if !listFlag.noTrunc && len(i.ImageSummary.ID) >= 12 { return i.ImageSummary.ID[0:12] } - return i.ImageSummary.ID + return "sha256:" + i.ImageSummary.ID } func (i imageReporter) Created() string { - return units.HumanDuration(time.Since(time.Unix(i.ImageSummary.Created, 0))) + " ago" + return units.HumanDuration(time.Since(i.ImageSummary.Created)) + " ago" } func (i imageReporter) Size() string { |