mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
Don't bind pre-bound pvc & pv if size request not satisfied
This commit is contained in:
parent
5962874414
commit
fe817674ab
@ -117,9 +117,14 @@ func (pvIndex *persistentVolumeOrderedIndex) findByClaim(claim *api.PersistentVo
|
||||
// the claim.
|
||||
for _, volume := range volumes {
|
||||
if isVolumeBoundToClaim(volume, claim) {
|
||||
// this claim and volume are bound; return it,
|
||||
// whether the claim is prebound or for volumes
|
||||
// intended for dynamic provisioning v1
|
||||
// this claim and volume are pre-bound; return
|
||||
// the volume if the size request is satisfied,
|
||||
// otherwise leave the claim pending
|
||||
volumeQty := volume.Spec.Capacity[api.ResourceStorage]
|
||||
volumeSize := volumeQty.Value()
|
||||
if volumeSize < requestedSize {
|
||||
return nil, nil
|
||||
}
|
||||
return volume, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user