Skip to content

Commit 82ed002

Browse files
committed
feat: add container creation timestamp to RuntimeContainer
1 parent 436e98d commit 82ed002

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

internal/context/context.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"os"
77
"regexp"
88
"sync"
9+
"time"
910

1011
docker "github.com/fsouza/go-dockerclient"
1112
"github.com/nginx-proxy/docker-gen/internal/utils"
@@ -91,6 +92,7 @@ type Health struct {
9192

9293
type RuntimeContainer struct {
9394
ID string
95+
Created time.Time
9496
Addresses []Address
9597
Networks []Network
9698
Gateway string

internal/generator/generator.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,8 @@ func (g *generator) getContainers() ([]*context.RuntimeContainer, error) {
393393

394394
registry, repository, tag := dockerclient.SplitDockerImage(container.Config.Image)
395395
runtimeContainer := &context.RuntimeContainer{
396-
ID: container.ID,
396+
ID: container.ID,
397+
Created: container.Created,
397398
Image: context.DockerImage{
398399
Registry: registry,
399400
Repository: repository,

0 commit comments

Comments
 (0)