Fix bug in dockershim to set sandbox id properly.

This commit is contained in:
Random-Liu
2016-10-01 20:55:06 -07:00
parent 56be1976fc
commit 37273693e5
2 changed files with 17 additions and 14 deletions

View File

@@ -56,8 +56,10 @@ func toRuntimeAPIContainer(c *dockertypes.Container) (*runtimeApi.Container, err
return nil, err
}
labels, annotations := extractLabels(c.Labels)
sandboxID := c.Labels[sandboxIDLabelKey]
return &runtimeApi.Container{
Id: &c.ID,
PodSandboxId: &sandboxID,
Metadata: metadata,
Image: &runtimeApi.ImageSpec{Image: &c.Image},
ImageRef: &c.ImageID,

View File

@@ -75,6 +75,7 @@ func TestListContainers(t *testing.T) {
expected = append([]*runtimeApi.Container{{
Metadata: configs[i].Metadata,
Id: &id,
PodSandboxId: &sandboxID,
State: &state,
Image: configs[i].Image,
ImageRef: &imageRef,