mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 05:21:58 +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.
|
// the claim.
|
||||||
for _, volume := range volumes {
|
for _, volume := range volumes {
|
||||||
if isVolumeBoundToClaim(volume, claim) {
|
if isVolumeBoundToClaim(volume, claim) {
|
||||||
// this claim and volume are bound; return it,
|
// this claim and volume are pre-bound; return
|
||||||
// whether the claim is prebound or for volumes
|
// the volume if the size request is satisfied,
|
||||||
// intended for dynamic provisioning v1
|
// otherwise leave the claim pending
|
||||||
|
volumeQty := volume.Spec.Capacity[api.ResourceStorage]
|
||||||
|
volumeSize := volumeQty.Value()
|
||||||
|
if volumeSize < requestedSize {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
return volume, nil
|
return volume, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user