Be lenient when asked to shrink a persisten volume.
Do not hard error, emit a warning instead. The cluster is not going to be broken because of our refusal to shrink a volume.
This commit is contained in:
parent
1ea8b3bbe6
commit
76ea754fc3
|
|
@ -103,10 +103,10 @@ func (c *Cluster) resizeVolumes(newVolume spec.Volume, resizers []volumes.Volume
|
|||
|
||||
for _, pv := range pvs {
|
||||
volumeSize := quantityToGigabyte(pv.Spec.Capacity[v1.ResourceStorage])
|
||||
if volumeSize > newSize {
|
||||
return fmt.Errorf("cannot shrink persistent volume")
|
||||
}
|
||||
if volumeSize == newSize {
|
||||
if volumeSize >= newSize {
|
||||
if volumeSize > newSize {
|
||||
c.logger.Warningf("cannot shrink persistent volume")
|
||||
}
|
||||
continue
|
||||
}
|
||||
for _, resizer := range resizers {
|
||||
|
|
|
|||
Loading…
Reference in New Issue