diff --git a/internal/runtime/podman.go b/internal/runtime/podman.go index a6996e5..846a5b4 100644 --- a/internal/runtime/podman.go +++ b/internal/runtime/podman.go @@ -215,10 +215,11 @@ func (p *Podman) ImageExists(ctx context.Context, image string) (bool, error) { // podmanPSEntry is a single entry from podman ps --format json. type podmanPSEntry struct { - Names []string `json:"Names"` - Image string `json:"Image"` - State string `json:"State"` - Command []string `json:"Command"` + Names []string `json:"Names"` + Image string `json:"Image"` + State string `json:"State"` + Command []string `json:"Command"` + StartedAt int64 `json:"StartedAt"` } // List returns information about all containers. @@ -240,12 +241,16 @@ func (p *Podman) List(ctx context.Context) ([]ContainerInfo, error) { if len(e.Names) > 0 { name = e.Names[0] } - infos = append(infos, ContainerInfo{ + info := ContainerInfo{ Name: name, Image: e.Image, State: e.State, Version: ExtractVersion(e.Image), - }) + } + if e.StartedAt > 0 { + info.Started = time.Unix(e.StartedAt, 0) + } + infos = append(infos, info) } return infos, nil