Fix a bug where the target pod doesn't become schedulable within 5 minutes when a deleted pod uses the same PVC with the ReadWriteOncePod access mode. (#126263)

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>
This commit is contained in:
杨朱 · Kiki
2024-07-22 16:20:34 +08:00
committed by GitHub
parent 00d03ec049
commit bc3c07091b
2 changed files with 37 additions and 1 deletions

View File

@@ -640,6 +640,22 @@ func Test_isSchedulableAfterPodDeleted(t *testing.T) {
expectedHint: framework.QueueSkip,
expectedErr: false,
},
"queue-has-same-claim": {
pod: st.MakePod().Name("pod1").PVC("claim-rwop").Obj(),
oldObj: st.MakePod().Name("pod2").PVC("claim-rwop").Obj(),
existingPods: []*v1.Pod{},
existingPVC: &v1.PersistentVolumeClaim{},
expectedHint: framework.Queue,
expectedErr: false,
},
"skip-no-same-claim": {
pod: st.MakePod().Name("pod1").PVC("claim-1-rwop").Obj(),
oldObj: st.MakePod().Name("pod2").PVC("claim-2-rwop").Obj(),
existingPods: []*v1.Pod{},
existingPVC: &v1.PersistentVolumeClaim{},
expectedHint: framework.QueueSkip,
expectedErr: false,
},
}
for name, tc := range testcases {