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