fix pv controller not find pv for pvc provisioning

This commit is contained in:
Yi Tang
2019-07-10 12:18:02 +08:00
parent cc0137cdc6
commit 8c13f9dea3
6 changed files with 94 additions and 39 deletions

View File

@@ -248,6 +248,17 @@ func TestSync(t *testing.T) {
},
noevents, noerrors, testSyncClaim,
},
{
// syncClaim that scheduled to a selected node
"1-18 - successful pre-bound PV to PVC provisioning",
newVolumeArray("volume1-18", "1Gi", "uid1-18", "claim1-18", v1.VolumeAvailable, v1.PersistentVolumeReclaimRetain, classWait),
newVolumeArray("volume1-18", "1Gi", "uid1-18", "claim1-18", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classWait),
claimWithAnnotation(pvutil.AnnSelectedNode, "node1",
newClaimArray("claim1-18", "uid1-18", "1Gi", "", v1.ClaimPending, &classWait)),
claimWithAnnotation(pvutil.AnnSelectedNode, "node1",
newClaimArray("claim1-18", "uid1-18", "1Gi", "volume1-18", v1.ClaimBound, &classWait, pvutil.AnnBoundByController, pvutil.AnnBindCompleted)),
noevents, noerrors, testSyncClaim,
},
// [Unit test set 2] User asked for a specific PV.
// Test the binding when pv.ClaimRef is already set by controller or