Fix data race in kubelet_test.go
Ensure that FakeDockerClient make a copy of the internal list and return it.
This commit is contained in:
@@ -139,7 +139,7 @@ func (f *FakeDockerClient) ListContainers(options docker.ListContainersOptions)
|
|||||||
if options.All {
|
if options.All {
|
||||||
return append(f.ContainerList, f.ExitedContainerList...), err
|
return append(f.ContainerList, f.ExitedContainerList...), err
|
||||||
}
|
}
|
||||||
return f.ContainerList, err
|
return append([]docker.APIContainers{}, f.ContainerList...), err
|
||||||
}
|
}
|
||||||
|
|
||||||
// InspectContainer is a test-spy implementation of DockerInterface.InspectContainer.
|
// InspectContainer is a test-spy implementation of DockerInterface.InspectContainer.
|
||||||
|
|||||||
Reference in New Issue
Block a user