- 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 adds a binding error message for volumeMode:Block
unsupported case.
With this message, users can understand why PV is not bound to
PVC on both dynamic provisioning and manually creating volume.
This patch works as follows:
- In syncVolume, before adding the claim to claimQueue, check if
there is a volumeMode mismatch, and if there is, record the
event for both pv and pvc and skip adding to the queue.
fixes: #59942
check if the volume requested by the claim satisfies the requirements of the claim before binding when
syncUnboundClaim and claim.Spec.VolumeName is not set
Also, fix unit tests to have the same claim and volume sizes in most of the
tests where we don't test matching based on size and test for a specific size
when we do actually test the matching.