diff --git a/CHANGELOG.md b/CHANGELOG.md index 0928167e..946de23a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/driver/controller.go b/driver/controller.go index dcb1a09a..35c93fd2 100644 --- a/driver/controller.go +++ b/driver/controller.go @@ -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 {