mirror of
https://github.com/docker/compose.git
synced 2025-09-20 08:17:50 +02:00
Fix: incorrect time when last tag time is not set
Signed-off-by: Kian Eliasi <kian.elbo@gmail.com>
This commit is contained in:
parent
51499f645b
commit
73e593e69a
@ -101,6 +101,10 @@ func runImages(ctx context.Context, dockerCli command.Cli, backend api.Service,
|
|||||||
// Convert map to slice
|
// Convert map to slice
|
||||||
var imageList []img
|
var imageList []img
|
||||||
for ctr, i := range images {
|
for ctr, i := range images {
|
||||||
|
lastTagTime := i.LastTagTime
|
||||||
|
if lastTagTime.IsZero() {
|
||||||
|
lastTagTime = time.Now()
|
||||||
|
}
|
||||||
imageList = append(imageList, img{
|
imageList = append(imageList, img{
|
||||||
ContainerName: ctr,
|
ContainerName: ctr,
|
||||||
ID: i.ID,
|
ID: i.ID,
|
||||||
@ -108,7 +112,7 @@ func runImages(ctx context.Context, dockerCli command.Cli, backend api.Service,
|
|||||||
Tag: i.Tag,
|
Tag: i.Tag,
|
||||||
Platform: platforms.Format(i.Platform),
|
Platform: platforms.Format(i.Platform),
|
||||||
Size: i.Size,
|
Size: i.Size,
|
||||||
LastTagTime: i.LastTagTime,
|
LastTagTime: lastTagTime,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
json, err := formatter.ToJSON(imageList, "", "")
|
json, err := formatter.ToJSON(imageList, "", "")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user