Remove container lifecycle image ref dependency.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2018-12-06 01:39:49 -08:00
parent db0c4dea24
commit 515ef02473
5 changed files with 62 additions and 36 deletions

View File

@@ -39,8 +39,9 @@ func TestContainerStore(t *testing.T) {
Attempt: 1,
},
},
ImageRef: "TestImage-1",
LogPath: "/test/log/path/1",
ImageRef: "TestImage-1",
StopSignal: "SIGTERM",
LogPath: "/test/log/path/1",
},
"2abcd": {
ID: "2abcd",
@@ -52,8 +53,9 @@ func TestContainerStore(t *testing.T) {
Attempt: 2,
},
},
ImageRef: "TestImage-2",
LogPath: "/test/log/path/2",
StopSignal: "SIGTERM",
ImageRef: "TestImage-2",
LogPath: "/test/log/path/2",
},
"4a333": {
ID: "4a333",
@@ -65,8 +67,9 @@ func TestContainerStore(t *testing.T) {
Attempt: 3,
},
},
ImageRef: "TestImage-3",
LogPath: "/test/log/path/3",
StopSignal: "SIGTERM",
ImageRef: "TestImage-3",
LogPath: "/test/log/path/3",
},
"4abcd": {
ID: "4abcd",
@@ -78,7 +81,8 @@ func TestContainerStore(t *testing.T) {
Attempt: 1,
},
},
ImageRef: "TestImage-4abcd",
StopSignal: "SIGTERM",
ImageRef: "TestImage-4abcd",
},
}
statuses := map[string]Status{
@@ -182,8 +186,9 @@ func TestWithContainerIO(t *testing.T) {
Attempt: 1,
},
},
ImageRef: "TestImage-1",
LogPath: "/test/log/path",
ImageRef: "TestImage-1",
StopSignal: "SIGTERM",
LogPath: "/test/log/path",
}
status := Status{
Pid: 1,

View File

@@ -27,7 +27,7 @@ import (
// 1) Metadata is immutable after created.
// 2) Metadata is checkpointed as containerd container label.
// metadataVersion is current version of container metadata.
// metadataVersion is current version of container metadata.
const metadataVersion = "v1" // nolint
// versionedMetadata is the internal versioned container metadata.
@@ -58,6 +58,9 @@ type Metadata struct {
ImageRef string
// LogPath is the container log path.
LogPath string
// StopSignal is the system call signal that will be sent to the container to exit.
// TODO(random-liu): Add integration test for stop signal.
StopSignal string
}
// MarshalJSON encodes Metadata into bytes in json format.