mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
Merge pull request #102292 from tsmetana/fix-local-pv-e2e-pv-leak
Local PV e2e: fix leaked local volumes
This commit is contained in:
commit
c4df930252
@ -373,11 +373,11 @@ var _ = utils.SIGDescribe("PersistentVolumes-local ", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should fail scheduling due to different NodeAffinity", func() {
|
ginkgo.It("should fail scheduling due to different NodeAffinity", func() {
|
||||||
testPodWithNodeConflict(config, volumeType, conflictNodeName, makeLocalPodWithNodeAffinity, immediateMode)
|
testPodWithNodeConflict(config, testVol, conflictNodeName, makeLocalPodWithNodeAffinity)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should fail scheduling due to different NodeSelector", func() {
|
ginkgo.It("should fail scheduling due to different NodeSelector", func() {
|
||||||
testPodWithNodeConflict(config, volumeType, conflictNodeName, makeLocalPodWithNodeSelector, immediateMode)
|
testPodWithNodeConflict(config, testVol, conflictNodeName, makeLocalPodWithNodeSelector)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -716,10 +716,8 @@ func deletePodAndPVCs(config *localTestConfig, pod *v1.Pod) error {
|
|||||||
|
|
||||||
type makeLocalPodWith func(config *localTestConfig, volume *localTestVolume, nodeName string) *v1.Pod
|
type makeLocalPodWith func(config *localTestConfig, volume *localTestVolume, nodeName string) *v1.Pod
|
||||||
|
|
||||||
func testPodWithNodeConflict(config *localTestConfig, testVolType localVolumeType, nodeName string, makeLocalPodFunc makeLocalPodWith, bindingMode storagev1.VolumeBindingMode) {
|
func testPodWithNodeConflict(config *localTestConfig, testVol *localTestVolume, nodeName string, makeLocalPodFunc makeLocalPodWith) {
|
||||||
ginkgo.By(fmt.Sprintf("local-volume-type: %s", testVolType))
|
ginkgo.By(fmt.Sprintf("local-volume-type: %s", testVol.localVolumeType))
|
||||||
testVols := setupLocalVolumesPVCsPVs(config, testVolType, config.randomNode, 1, bindingMode)
|
|
||||||
testVol := testVols[0]
|
|
||||||
|
|
||||||
pod := makeLocalPodFunc(config, testVol, nodeName)
|
pod := makeLocalPodFunc(config, testVol, nodeName)
|
||||||
pod, err := config.client.CoreV1().Pods(config.ns).Create(context.TODO(), pod, metav1.CreateOptions{})
|
pod, err := config.client.CoreV1().Pods(config.ns).Create(context.TODO(), pod, metav1.CreateOptions{})
|
||||||
|
Loading…
Reference in New Issue
Block a user