Skip to content

Commit

Permalink
CON-9337 fix resize logic from snapshot (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
llDrLove authored May 17, 2023
1 parent 6362cd9 commit 331d6c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## v4.6.1 - 2023.05.17
* Update CSI sidecars to latest
[[GH-502]](https://github.com/digitalocean/csi-digitalocean/pull/502)
* Fix snapshot resizing
[[GH-504]](https://github.com/digitalocean/csi-digitalocean/pull/504)

## v4.6.0 - 2023.05.02

Expand Down
2 changes: 1 addition & 1 deletion driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
return nil, status.Error(codes.Internal, err.Error())
}

if snapshot != nil && volumeReq.SizeGigaBytes > int64(snapshot.SizeGigaBytes) && volumeReq.SizeGigaBytes > 1 {
if vol.SizeGigaBytes < volumeReq.SizeGigaBytes {
log.Info("resizing volume because its requested size is larger than the size of the backing snapshot")
action, _, err := d.storageActions.Resize(ctx, vol.ID, int(volumeReq.SizeGigaBytes), volumeReq.Region)
if err != nil {
Expand Down

0 comments on commit 331d6c2

Please sign in to comment.