diff options
author | Brent Baude <bbaude@redhat.com> | 2020-04-14 13:20:59 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-04-14 19:47:49 -0500 |
commit | 60dde457f6dc5ec5062a946dbd0848a2b0b06a22 (patch) | |
tree | d2ff642f668c58860f6e3aa03f1356fb84b95a1d /cmd/podmanV2/images/history.go | |
parent | f0b6cdede554316643187d40c67684daf5a2a2bb (diff) | |
download | podman-60dde457f6dc5ec5062a946dbd0848a2b0b06a22.tar.gz podman-60dde457f6dc5ec5062a946dbd0848a2b0b06a22.tar.bz2 podman-60dde457f6dc5ec5062a946dbd0848a2b0b06a22.zip |
More system test fixes on regressions
Fix more regressions between v1 and v2
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podmanV2/images/history.go')
-rw-r--r-- | cmd/podmanV2/images/history.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cmd/podmanV2/images/history.go b/cmd/podmanV2/images/history.go index 48575b33a..e3bb7a051 100644 --- a/cmd/podmanV2/images/history.go +++ b/cmd/podmanV2/images/history.go @@ -53,7 +53,7 @@ func init() { flags := historyCmd.Flags() flags.StringVar(&opts.format, "format", "", "Change the output to JSON or a Go template") - flags.BoolVarP(&opts.human, "human", "H", false, "Display sizes and dates in human readable format") + flags.BoolVarP(&opts.human, "human", "H", true, "Display sizes and dates in human readable format") flags.BoolVar(&opts.noTrunc, "no-trunc", false, "Do not truncate the output") flags.BoolVar(&opts.noTrunc, "notruncate", false, "Do not truncate the output") flags.BoolVarP(&opts.quiet, "quiet", "q", false, "Display the numeric IDs only") @@ -79,7 +79,7 @@ func history(cmd *cobra.Command, args []string) error { layers := make([]layer, len(results.Layers)) for i, l := range results.Layers { layers[i].ImageHistoryLayer = l - layers[i].Created = time.Unix(l.Created, 0).Format(time.RFC3339) + layers[i].Created = l.Created.Format(time.RFC3339) } json := jsoniter.ConfigCompatibleWithStandardLibrary enc := json.NewEncoder(os.Stdout) @@ -129,7 +129,10 @@ type historyreporter struct { } func (h historyreporter) Created() string { - return units.HumanDuration(time.Since(time.Unix(h.ImageHistoryLayer.Created, 0))) + " ago" + if opts.human { + return units.HumanDuration(time.Since(h.ImageHistoryLayer.Created)) + " ago" + } + return h.ImageHistoryLayer.Created.Format(time.RFC3339) } func (h historyreporter) Size() string { |