mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-18 19:31:57 +02:00
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:
@@ -103,10 +103,10 @@ func (c *Cluster) resizeVolumes(newVolume spec.Volume, resizers []volumes.Volume
|
|||||||
|
|
||||||
for _, pv := range pvs {
|
for _, pv := range pvs {
|
||||||
volumeSize := quantityToGigabyte(pv.Spec.Capacity[v1.ResourceStorage])
|
volumeSize := quantityToGigabyte(pv.Spec.Capacity[v1.ResourceStorage])
|
||||||
if volumeSize > newSize {
|
if volumeSize >= newSize {
|
||||||
return fmt.Errorf("cannot shrink persistent volume")
|
if volumeSize > newSize {
|
||||||
}
|
c.logger.Warningf("cannot shrink persistent volume")
|
||||||
if volumeSize == newSize {
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for _, resizer := range resizers {
|
for _, resizer := range resizers {
|
||||||
|
|||||||
Reference in New Issue
Block a user