Ignore non-avaiable volumes in findMatchingVolume: update tests

- Use VolumeAvaiable instead of empty or pending phase in tests
- Add a test case to verify findMatchingVolume will not choose
  non-avaiable PVs if it's not pre-bind
- Add a test case to verify syncClaim will not choose non-avaibalbe PVs
  if it's not pre-bind
This commit is contained in:
Yecheng Fu
2018-09-14 20:02:04 +08:00
parent b3cb1bdc4a
commit 1e27a28dca
5 changed files with 301 additions and 91 deletions

View File

@@ -1222,6 +1222,9 @@ func (plugin *mockVolumePlugin) Provision(selectedNode *v1.Node, allowedTopologi
GCEPersistentDisk: &v1.GCEPersistentDiskVolumeSource{},
},
},
Status: v1.PersistentVolumeStatus{
Phase: v1.VolumeAvailable,
},
}
}