mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 05:46:16 +00:00
Fix mesos plugin-test race
ListWatch returned the internal list of the MockPodsListWatch object, leading to a race. Fixes travis builds. Fixes mesosphere/kubernetes-mesos#354
This commit is contained in:
parent
5e5c1d1097
commit
615e4f99a7
@ -120,7 +120,11 @@ func NewMockPodsListWatch(initialPodList api.PodList) *MockPodsListWatch {
|
|||||||
return lw.fakeWatcher, nil
|
return lw.fakeWatcher, nil
|
||||||
},
|
},
|
||||||
ListFunc: func() (runtime.Object, error) {
|
ListFunc: func() (runtime.Object, error) {
|
||||||
return &lw.list, nil
|
lw.lock.Lock()
|
||||||
|
defer lw.lock.Unlock()
|
||||||
|
|
||||||
|
listCopy, err := api.Scheme.DeepCopy(&lw.list)
|
||||||
|
return listCopy.(*api.PodList), err
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
return &lw
|
return &lw
|
||||||
|
Loading…
Reference in New Issue
Block a user