summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-02-13 09:53:56 -0500
committerGitHub <noreply@github.com>2021-02-13 09:53:56 -0500
commit797f1ea8cd0b7f4f85df4cf069bcd64c37a8ed1d (patch)
treea4a9b7d4f8ea7ce9ae9569c04374d54a0533cafd /cmd/podman
parent001059259d0bb3acc70d943ebe13477fb9014206 (diff)
parentf36d860385a1d33a2aabea7b4848ef6217398c3c (diff)
downloadpodman-797f1ea8cd0b7f4f85df4cf069bcd64c37a8ed1d.tar.gz
podman-797f1ea8cd0b7f4f85df4cf069bcd64c37a8ed1d.tar.bz2
podman-797f1ea8cd0b7f4f85df4cf069bcd64c37a8ed1d.zip
Merge pull request #9349 from baude/v3unixts
V3unixts [3.0 Backports]
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/containers/ps.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/cmd/podman/containers/ps.go b/cmd/podman/containers/ps.go
index 0b5bd22fc..23baca70f 100644
--- a/cmd/podman/containers/ps.go
+++ b/cmd/podman/containers/ps.go
@@ -142,11 +142,19 @@ func checkFlags(c *cobra.Command) error {
}
func jsonOut(responses []entities.ListContainer) error {
- r := make([]entities.ListContainer, 0)
+ type jsonFormat struct {
+ entities.ListContainer
+ Created int64
+ }
+ r := make([]jsonFormat, 0)
for _, con := range responses {
con.CreatedAt = units.HumanDuration(time.Since(con.Created)) + " ago"
con.Status = psReporter{con}.Status()
- r = append(r, con)
+ jf := jsonFormat{
+ ListContainer: con,
+ Created: con.Created.Unix(),
+ }
+ r = append(r, jf)
}
b, err := json.MarshalIndent(r, "", " ")
if err != nil {