Return image tag as image spec.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2017-11-06 06:05:49 +00:00
parent 8a1a2f2713
commit 050ee1de95
2 changed files with 20 additions and 6 deletions

View File

@@ -63,6 +63,7 @@ func getContainerStatusTestData() (*containerstore.Metadata, *containerstore.Sta
}
image := &imagestore.Image{
ID: "test-image-id",
RepoTags: []string{"test-image-repo-tag"},
RepoDigests: []string{"test-image-repo-digest"},
}
expected := &runtime.ContainerStatus{
@@ -71,7 +72,7 @@ func getContainerStatusTestData() (*containerstore.Metadata, *containerstore.Sta
State: runtime.ContainerState_CONTAINER_RUNNING,
CreatedAt: createdAt,
StartedAt: startedAt,
Image: config.GetImage(),
Image: &runtime.ImageSpec{Image: "test-image-repo-tag"},
ImageRef: "test-image-repo-digest",
Reason: completeExitReason,
Labels: config.GetLabels(),
@@ -135,7 +136,9 @@ func TestToCRIContainerStatus(t *testing.T) {
expected.FinishedAt = test.finishedAt
expected.ExitCode = test.exitCode
expected.Message = test.message
assert.Equal(t, expected, toCRIContainerStatus(container, image.RepoDigests[0]), desc)
assert.Equal(t, expected, toCRIContainerStatus(container,
&runtime.ImageSpec{Image: image.RepoTags[0]},
image.RepoDigests[0]), desc)
}
}