mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #53851 from jianglingxia/jlx-deferfunc
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. defer func of kubelet volume testing **What this PR does / why we need it**: there has some defer func ,I think maybe modify better,thanks! **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
commit
9e792173d0
@ -58,9 +58,7 @@ func TestListVolumesForPod(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
stopCh := runVolumeManager(kubelet)
|
stopCh := runVolumeManager(kubelet)
|
||||||
defer func() {
|
defer close(stopCh)
|
||||||
close(stopCh)
|
|
||||||
}()
|
|
||||||
|
|
||||||
kubelet.podManager.SetPods([]*v1.Pod{pod})
|
kubelet.podManager.SetPods([]*v1.Pod{pod})
|
||||||
err := kubelet.volumeManager.WaitForAttachAndMount(pod)
|
err := kubelet.volumeManager.WaitForAttachAndMount(pod)
|
||||||
@ -142,9 +140,7 @@ func TestPodVolumesExist(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stopCh := runVolumeManager(kubelet)
|
stopCh := runVolumeManager(kubelet)
|
||||||
defer func() {
|
defer close(stopCh)
|
||||||
close(stopCh)
|
|
||||||
}()
|
|
||||||
|
|
||||||
kubelet.podManager.SetPods(pods)
|
kubelet.podManager.SetPods(pods)
|
||||||
for _, pod := range pods {
|
for _, pod := range pods {
|
||||||
@ -177,9 +173,7 @@ func TestVolumeAttachAndMountControllerDisabled(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
stopCh := runVolumeManager(kubelet)
|
stopCh := runVolumeManager(kubelet)
|
||||||
defer func() {
|
defer close(stopCh)
|
||||||
close(stopCh)
|
|
||||||
}()
|
|
||||||
|
|
||||||
kubelet.podManager.SetPods([]*v1.Pod{pod})
|
kubelet.podManager.SetPods([]*v1.Pod{pod})
|
||||||
err := kubelet.volumeManager.WaitForAttachAndMount(pod)
|
err := kubelet.volumeManager.WaitForAttachAndMount(pod)
|
||||||
@ -223,9 +217,7 @@ func TestVolumeUnmountAndDetachControllerDisabled(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
stopCh := runVolumeManager(kubelet)
|
stopCh := runVolumeManager(kubelet)
|
||||||
defer func() {
|
defer close(stopCh)
|
||||||
close(stopCh)
|
|
||||||
}()
|
|
||||||
|
|
||||||
// Add pod
|
// Add pod
|
||||||
kubelet.podManager.SetPods([]*v1.Pod{pod})
|
kubelet.podManager.SetPods([]*v1.Pod{pod})
|
||||||
@ -312,9 +304,7 @@ func TestVolumeAttachAndMountControllerEnabled(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
stopCh := runVolumeManager(kubelet)
|
stopCh := runVolumeManager(kubelet)
|
||||||
defer func() {
|
defer close(stopCh)
|
||||||
close(stopCh)
|
|
||||||
}()
|
|
||||||
|
|
||||||
kubelet.podManager.SetPods([]*v1.Pod{pod})
|
kubelet.podManager.SetPods([]*v1.Pod{pod})
|
||||||
|
|
||||||
@ -381,9 +371,7 @@ func TestVolumeUnmountAndDetachControllerEnabled(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
stopCh := runVolumeManager(kubelet)
|
stopCh := runVolumeManager(kubelet)
|
||||||
defer func() {
|
defer close(stopCh)
|
||||||
close(stopCh)
|
|
||||||
}()
|
|
||||||
|
|
||||||
// Add pod
|
// Add pod
|
||||||
kubelet.podManager.SetPods([]*v1.Pod{pod})
|
kubelet.podManager.SetPods([]*v1.Pod{pod})
|
||||||
|
Loading…
Reference in New Issue
Block a user