Merge pull request #179 from Random-Liu/checkpoint-container-status

Checkpoint container status onto disk.
This commit is contained in:
Lantao Liu
2017-09-06 13:51:38 -07:00
committed by GitHub
19 changed files with 1019 additions and 63 deletions

View File

@@ -122,7 +122,10 @@ func TestToCRIContainerStatus(t *testing.T) {
status.ExitCode = test.exitCode
status.Reason = test.reason
status.Message = test.message
container, err := containerstore.NewContainer(*metadata, *status)
container, err := containerstore.NewContainer(
*metadata,
containerstore.WithFakeStatus(*status),
)
assert.NoError(t, err)
// Set expectation based on test case.
expected.State = test.expectedState
@@ -172,7 +175,10 @@ func TestContainerStatus(t *testing.T) {
// Update status with test case.
status.FinishedAt = test.finishedAt
status.Reason = test.reason
container, err := containerstore.NewContainer(*metadata, *status)
container, err := containerstore.NewContainer(
*metadata,
containerstore.WithFakeStatus(*status),
)
assert.NoError(t, err)
if test.exist {
assert.NoError(t, c.containerStore.Add(container))