From 19b56cf7a105951217b90bfd98eec89b90b7706f Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Fri, 24 Jul 2026 15:48:18 +0200 Subject: [PATCH] only pass set variable to modify input --- pkg/util/volumes/ebs.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkg/util/volumes/ebs.go b/pkg/util/volumes/ebs.go index 9bffe6437..212ee8ac4 100644 --- a/pkg/util/volumes/ebs.go +++ b/pkg/util/volumes/ebs.go @@ -155,31 +155,32 @@ func (r *EBSVolumeResizer) ResizeVolume(volumeID string, newSize int64) error { // ModifyVolume Modify EBS volume func (r *EBSVolumeResizer) ModifyVolume(volumeID string, newType *string, newSize *int64, iops *int64, throughput *int64) error { - /* first check if the volume is already of a requested size */ var sizeInt32 *int32 var iopsInt32 *int32 var throughputInt32 *int32 + + input := ec2.ModifyVolumeInput{ + VolumeId: &volumeID, + } if newSize != nil { s := int32(*newSize) sizeInt32 = &s + input.Size = sizeInt32 } if iops != nil { i := int32(*iops) iopsInt32 = &i + input.Iops = iopsInt32 } if throughput != nil { t := int32(*throughput) throughputInt32 = &t - } - input := ec2.ModifyVolumeInput{ - Size: sizeInt32, - VolumeId: &volumeID, - Iops: iopsInt32, - Throughput: throughputInt32, + input.Throughput = throughputInt32 } if newType != nil { input.VolumeType = types.VolumeType(*newType) } + output, err := r.connection.ModifyVolume(context.TODO(), &input) if err != nil { return fmt.Errorf("could not modify persistent volume: %v", err)