@@ -598,11 +598,9 @@ func extractVolumeKey(v *types.Volume, batcher volumeBatcherType) (string, error
598598
599599func (c * cloud ) CreateDisk (ctx context.Context , volumeName string , diskOptions * DiskOptions ) (* Disk , error ) {
600600 var (
601- createType string
602- iops int32
603- throughput int32
604- err error
605- requestedIops int32
601+ createType string
602+ iops int32
603+ err error
606604 )
607605
608606 capacityGiB := util .BytesToGiB (diskOptions .CapacityBytes )
@@ -688,13 +686,13 @@ func (c *cloud) CreateDisk(ctx context.Context, volumeName string, diskOptions *
688686 return nil , fmt .Errorf ("invalid AWS VolumeType %q" , diskOptions .VolumeType )
689687 }
690688
691- if iopsLimit . maxIops > 0 {
692- if diskOptions .IOPS > 0 {
693- requestedIops = diskOptions .IOPS
694- } else if diskOptions .IOPSPerGB > 0 {
695- requestedIops = diskOptions . IOPSPerGB * capacityGiB
696- }
697- iops = capIOPS (createType , capacityGiB , requestedIops , iopsLimit , diskOptions .AllowIOPSPerGBIncrease )
689+ if diskOptions . IOPS > 0 {
690+ iops = diskOptions .IOPS
691+ } else if diskOptions .IOPSPerGB > 0 {
692+ iops = diskOptions .IOPSPerGB * capacityGiB
693+ }
694+ if iopsLimit . maxIops > 0 && iops > 0 {
695+ iops = capIOPS (createType , capacityGiB , iops , iopsLimit , diskOptions .AllowIOPSPerGBIncrease )
698696 }
699697
700698 if len (diskOptions .KmsKeyID ) > 0 {
@@ -704,8 +702,8 @@ func (c *cloud) CreateDisk(ctx context.Context, volumeName string, diskOptions *
704702 if iops > 0 {
705703 requestInput .Iops = aws .Int32 (iops )
706704 }
707- if throughput > 0 {
708- requestInput .Throughput = aws .Int32 (throughput )
705+ if diskOptions . Throughput > 0 {
706+ requestInput .Throughput = aws .Int32 (diskOptions . Throughput )
709707 }
710708 snapshotID := diskOptions .SnapshotID
711709 if len (snapshotID ) > 0 {
0 commit comments