Skip to content

Commit

Permalink
fix: Do not reduce filesystem size when it was already set with bigge…
Browse files Browse the repository at this point in the history
…r size
  • Loading branch information
sergeyberezansky committed Mar 28, 2023
1 parent 35b02de commit 196f25b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/wekafs/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,7 @@ func (v *Volume) Create(ctx context.Context, capacity int64) error {
if v.isFilesystem() {
// filesystem size might be larger than free space, check it
fsSize := Max(capacity, v.initialFilesystemSize)
logger.Trace().Int64("pvc_capacity", capacity).Int64("fs_size", fsSize).Int64("initial_fs_size", v.initialFilesystemSize).Msg("")
if fsSize > maxStorageCapacity {
return status.Errorf(codes.OutOfRange, fmt.Sprintf("Minimum filesystem size %d is set in storageClass, which exceeds total free capacity %d", fsSize, maxStorageCapacity))
}
Expand Down

0 comments on commit 196f25b

Please sign in to comment.