From 657bba80dea0841f0c44da5a2766bc35e00dc7f0 Mon Sep 17 00:00:00 2001 From: moriya Date: Sun, 2 Jun 2024 23:54:39 +0900 Subject: [PATCH] simplify_test --- .../plugins/volumezone/volume_zone_test.go | 32 ++----------------- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/pkg/scheduler/framework/plugins/volumezone/volume_zone_test.go b/pkg/scheduler/framework/plugins/volumezone/volume_zone_test.go index 2a4fd60f590..76b1f7cdede 100644 --- a/pkg/scheduler/framework/plugins/volumezone/volume_zone_test.go +++ b/pkg/scheduler/framework/plugins/volumezone/volume_zone_test.go @@ -586,7 +586,7 @@ func TestIsSchedulableAfterPersistentVolumeClaimAdded(t *testing.T) { expectedHint: framework.Queue, expectedErr: true, }, - "pvc-was-added-and-pod-was-not-bound-to-pvc": { + "pvc-was-added-but-pod-was-not-bound-to-pvc": { pod: st.MakePod().Name("pod_1").Namespace("default").Obj(), newObj: &v1.PersistentVolumeClaim{ ObjectMeta: metav1.ObjectMeta{Name: "PVC_1", Namespace: "default"}, @@ -618,22 +618,6 @@ func TestIsSchedulableAfterPersistentVolumeClaimAdded(t *testing.T) { }, expectedHint: framework.Queue, }, - "pvc-was-added-and-pod-was-bound-to-added-pvc, pvc-bound-to-storage-class-with-not-wait-mode": { - pod: createPodWithVolume("pod_1", "PVC_2"), - newObj: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{Name: "PVC_2", Namespace: "default"}, - Spec: v1.PersistentVolumeClaimSpec{StorageClassName: ptr.To("SC_1")}, - }, - expectedHint: framework.Queue, - }, - "pvc-was-added-and-pod-was-bound-to-added-pvc, pvc-bound-to-storage-class-with-wait-mode": { - pod: createPodWithVolume("pod_1", "PVC_3"), - newObj: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{Name: "PVC_3", Namespace: "default"}, - Spec: v1.PersistentVolumeClaimSpec{StorageClassName: ptr.To("SC_2")}, - }, - expectedHint: framework.Queue, - }, "pvc-was-updated-and-pod-was-bound-to-pvc": { pod: createPodWithVolume("pod_1", "PVC_1"), oldObj: &v1.PersistentVolumeClaim{ @@ -646,18 +630,6 @@ func TestIsSchedulableAfterPersistentVolumeClaimAdded(t *testing.T) { }, expectedHint: framework.Queue, }, - "pvc-was-updated-but-pv-doesn't-change": { - pod: createPodWithVolume("pod_1", "PVC_1"), - oldObj: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{Name: "PVC_1", Namespace: "default"}, - Spec: v1.PersistentVolumeClaimSpec{VolumeName: "Vol_1"}, - }, - newObj: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{Name: "PVC_1", Namespace: "default"}, - Spec: v1.PersistentVolumeClaimSpec{VolumeName: "Vol_1"}, - }, - expectedHint: framework.Queue, - }, "pvc-was-updated-but-pod-was-not-bound-to-pvc": { pod: createPodWithVolume("pod_1", ""), oldObj: &v1.PersistentVolumeClaim{ @@ -666,7 +638,7 @@ func TestIsSchedulableAfterPersistentVolumeClaimAdded(t *testing.T) { }, newObj: &v1.PersistentVolumeClaim{ ObjectMeta: metav1.ObjectMeta{Name: "PVC_1", Namespace: "default"}, - Spec: v1.PersistentVolumeClaimSpec{VolumeName: ""}, + Spec: v1.PersistentVolumeClaimSpec{VolumeName: "Vol_1"}, }, expectedHint: framework.QueueSkip, },