Get CreatedAt from containerd instead of maintaining it ourselves.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2017-08-23 23:42:31 +00:00
parent 73bb9696e8
commit a795927c5a
8 changed files with 101 additions and 27 deletions

View File

@@ -46,9 +46,6 @@ type Metadata struct {
Name string
// Config is the CRI sandbox config.
Config *runtime.PodSandboxConfig
// CreatedAt is the created timestamp.
// TODO(random-liu): Use containerd container CreatedAt (containerd#933)
CreatedAt int64
// Pid is the process id of the sandbox.
Pid uint32
// NetNSPath is the network namespace used by the sandbox.

View File

@@ -19,7 +19,6 @@ package sandbox
import (
"encoding/json"
"testing"
"time"
assertlib "github.com/stretchr/testify/assert"
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
@@ -37,7 +36,6 @@ func TestMetadataEncodeDecode(t *testing.T) {
Attempt: 1,
},
},
CreatedAt: time.Now().UnixNano(),
}
assert := assertlib.New(t)
data, err := meta.Encode()

View File

@@ -18,7 +18,6 @@ package sandbox
import (
"testing"
"time"
assertlib "github.com/stretchr/testify/assert"
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
@@ -40,7 +39,6 @@ func TestSandboxStore(t *testing.T) {
Attempt: 1,
},
},
CreatedAt: time.Now().UnixNano(),
Pid: 1001,
NetNSPath: "TestNetNS-1",
},
@@ -55,7 +53,6 @@ func TestSandboxStore(t *testing.T) {
Attempt: 2,
},
},
CreatedAt: time.Now().UnixNano(),
Pid: 1002,
NetNSPath: "TestNetNS-2",
},
@@ -70,7 +67,6 @@ func TestSandboxStore(t *testing.T) {
Attempt: 3,
},
},
CreatedAt: time.Now().UnixNano(),
Pid: 1003,
NetNSPath: "TestNetNS-3",
},