mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-08 14:29:45 +00:00
PV Controller: fix recycling
In the situation when a PVC is deleted and a new one with the same name bound to a different PV the "old" PV may fail to recycle since it's associaded with a PVC that is detected as being in use. This may cause the recycler processes to hang.
This commit is contained in:
@@ -229,6 +229,16 @@ func TestRecycleSync(t *testing.T) {
|
||||
// recycler simulates one recycle() call that succeeds.
|
||||
wrapTestWithReclaimCalls(operationRecycle, []error{nil}, testSyncVolume),
|
||||
},
|
||||
{
|
||||
// volume is used by a completed pod, pod using claim with the same name bound to different pv is running, should recycle
|
||||
"6-14 - seemingly used by running pod",
|
||||
newVolumeArray("volume6-14", "1Gi", "uid6-14", "completedClaim", v1.VolumeBound, v1.PersistentVolumeReclaimRecycle, classEmpty, annBoundByController),
|
||||
newVolumeArray("volume6-14", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimRecycle, classEmpty),
|
||||
newClaimArray("completedClaim", "uid6-14-x", "10Gi", "", v1.ClaimBound, nil),
|
||||
newClaimArray("completedClaim", "uid6-14-x", "10Gi", "", v1.ClaimBound, nil),
|
||||
noevents, noerrors,
|
||||
wrapTestWithReclaimCalls(operationRecycle, []error{nil}, testSyncVolume),
|
||||
},
|
||||
}
|
||||
runSyncTests(t, tests, []*storage.StorageClass{}, pods)
|
||||
}
|
||||
|
Reference in New Issue
Block a user