server: store sandbox creation time
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
81cfba283a
commit
fb90eccb42
2 changed files with 7 additions and 0 deletions
|
@ -7,6 +7,7 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/containernetworking/cni/pkg/ns"
|
||||
|
@ -145,6 +146,7 @@ type sandbox struct {
|
|||
privileged bool
|
||||
resolvPath string
|
||||
hostname string
|
||||
created time.Time
|
||||
}
|
||||
|
||||
const (
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
"path/filepath"
|
||||
"strconv"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/containers/storage/storage"
|
||||
|
@ -267,6 +268,9 @@ func (s *Server) RunPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest
|
|||
g.AddAnnotation("ocid/hostname", hostname)
|
||||
g.AddAnnotation("ocid/kube_name", kubeName)
|
||||
|
||||
created := time.Now()
|
||||
g.AddAnnotation("ocid/created", created.Format(time.RFC3339Nano))
|
||||
|
||||
sb := &sandbox{
|
||||
id: id,
|
||||
namespace: namespace,
|
||||
|
@ -283,6 +287,7 @@ func (s *Server) RunPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest
|
|||
privileged: privileged,
|
||||
resolvPath: resolvPath,
|
||||
hostname: hostname,
|
||||
created: created,
|
||||
}
|
||||
|
||||
defer func() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue