Fix bug in dockershim to set sandbox id properly.
This commit is contained in:
@@ -56,8 +56,10 @@ func toRuntimeAPIContainer(c *dockertypes.Container) (*runtimeApi.Container, err
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
labels, annotations := extractLabels(c.Labels)
|
labels, annotations := extractLabels(c.Labels)
|
||||||
|
sandboxID := c.Labels[sandboxIDLabelKey]
|
||||||
return &runtimeApi.Container{
|
return &runtimeApi.Container{
|
||||||
Id: &c.ID,
|
Id: &c.ID,
|
||||||
|
PodSandboxId: &sandboxID,
|
||||||
Metadata: metadata,
|
Metadata: metadata,
|
||||||
Image: &runtimeApi.ImageSpec{Image: &c.Image},
|
Image: &runtimeApi.ImageSpec{Image: &c.Image},
|
||||||
ImageRef: &c.ImageID,
|
ImageRef: &c.ImageID,
|
||||||
|
@@ -75,6 +75,7 @@ func TestListContainers(t *testing.T) {
|
|||||||
expected = append([]*runtimeApi.Container{{
|
expected = append([]*runtimeApi.Container{{
|
||||||
Metadata: configs[i].Metadata,
|
Metadata: configs[i].Metadata,
|
||||||
Id: &id,
|
Id: &id,
|
||||||
|
PodSandboxId: &sandboxID,
|
||||||
State: &state,
|
State: &state,
|
||||||
Image: configs[i].Image,
|
Image: configs[i].Image,
|
||||||
ImageRef: &imageRef,
|
ImageRef: &imageRef,
|
||||||
|
Reference in New Issue
Block a user