mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 21:36:24 +00:00
simplify_test
This commit is contained in:
parent
105f9396b8
commit
657bba80de
@ -586,7 +586,7 @@ func TestIsSchedulableAfterPersistentVolumeClaimAdded(t *testing.T) {
|
|||||||
expectedHint: framework.Queue,
|
expectedHint: framework.Queue,
|
||||||
expectedErr: true,
|
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(),
|
pod: st.MakePod().Name("pod_1").Namespace("default").Obj(),
|
||||||
newObj: &v1.PersistentVolumeClaim{
|
newObj: &v1.PersistentVolumeClaim{
|
||||||
ObjectMeta: metav1.ObjectMeta{Name: "PVC_1", Namespace: "default"},
|
ObjectMeta: metav1.ObjectMeta{Name: "PVC_1", Namespace: "default"},
|
||||||
@ -618,22 +618,6 @@ func TestIsSchedulableAfterPersistentVolumeClaimAdded(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expectedHint: framework.Queue,
|
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": {
|
"pvc-was-updated-and-pod-was-bound-to-pvc": {
|
||||||
pod: createPodWithVolume("pod_1", "PVC_1"),
|
pod: createPodWithVolume("pod_1", "PVC_1"),
|
||||||
oldObj: &v1.PersistentVolumeClaim{
|
oldObj: &v1.PersistentVolumeClaim{
|
||||||
@ -646,18 +630,6 @@ func TestIsSchedulableAfterPersistentVolumeClaimAdded(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expectedHint: framework.Queue,
|
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": {
|
"pvc-was-updated-but-pod-was-not-bound-to-pvc": {
|
||||||
pod: createPodWithVolume("pod_1", ""),
|
pod: createPodWithVolume("pod_1", ""),
|
||||||
oldObj: &v1.PersistentVolumeClaim{
|
oldObj: &v1.PersistentVolumeClaim{
|
||||||
@ -666,7 +638,7 @@ func TestIsSchedulableAfterPersistentVolumeClaimAdded(t *testing.T) {
|
|||||||
},
|
},
|
||||||
newObj: &v1.PersistentVolumeClaim{
|
newObj: &v1.PersistentVolumeClaim{
|
||||||
ObjectMeta: metav1.ObjectMeta{Name: "PVC_1", Namespace: "default"},
|
ObjectMeta: metav1.ObjectMeta{Name: "PVC_1", Namespace: "default"},
|
||||||
Spec: v1.PersistentVolumeClaimSpec{VolumeName: ""},
|
Spec: v1.PersistentVolumeClaimSpec{VolumeName: "Vol_1"},
|
||||||
},
|
},
|
||||||
expectedHint: framework.QueueSkip,
|
expectedHint: framework.QueueSkip,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user