Merge pull request #33809 from Random-Liu/fix-mount-issue-in-dockershim

Automatic merge from submit-queue

CRI: Fix mount issue in dockershim.

For https://github.com/kubernetes/kubernetes/issues/33189.

The test `Container Runtime Conformance Test container runtime conformance blackbox test when starting a container that exits should report termination message if TerminationMessagePath is set` flakes a lot. (see https://k8s-testgrid.appspot.com/google-node#kubelet-cri-gce-e2e&width=5)

After some investigation, I found the problem is that we are using pointer of iterator.

This fixes the flake.

@yujuhong @feiskyer
This commit is contained in:
Kubernetes Submit Queue 2016-09-29 21:44:07 -07:00 committed by GitHub
commit 8f918d361b

View File

@ -227,7 +227,8 @@ func (ds *dockerService) ContainerStatus(containerID string) (*runtimeApi.Contai
// Convert the mounts.
mounts := []*runtimeApi.Mount{}
for _, m := range r.Mounts {
for i := range r.Mounts {
m := r.Mounts[i]
readonly := !m.RW
mounts = append(mounts, &runtimeApi.Mount{
Name: &m.Name,