Skip to content

Commit

Permalink
Be lenient when asked to shrink a persisten volume.
Browse files Browse the repository at this point in the history
Do not hard error, emit a warning instead. The cluster is not going
to be broken because of our refusal to shrink a volume.
  • Loading branch information
alexeyklyukin committed May 24, 2018
1 parent 1ea8b3b commit 76ea754
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/cluster/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 76ea754

Please sign in to comment.