mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Fix volume integration test flake
When we create a PV, we should created it withoud Spec.ClaimRef.UID. In rare cases, when 'PV added' event with UID is processed before 'PVC added' (created by for loop few lines above), the controller does not know a PVC with this UID and considers the PV as released. Reclaim policy is then executed and the PV is deleted and it's never bound. With UID="", the controller waits for the PVC to get created and binds it.
This commit is contained in:
parent
acc2d22765
commit
51c218ea7d
@ -242,6 +242,7 @@ func TestPersistentVolumeBindRace(t *testing.T) {
|
||||
t.Fatalf("Unexpected error getting claimRef: %v", err)
|
||||
}
|
||||
pv.Spec.ClaimRef = claimRef
|
||||
pv.Spec.ClaimRef.UID = ""
|
||||
|
||||
pv, err = testClient.PersistentVolumes().Create(pv)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user