From a763c8ab02ec45bd3d1d60ad3f67997e21c27f5c Mon Sep 17 00:00:00 2001 From: Aleksandr Serbin Date: Wed, 4 Nov 2020 20:49:04 +0100 Subject: [PATCH] amazon: validate IOPS only for io volumes --- builder/amazon/common/block_device.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builder/amazon/common/block_device.go b/builder/amazon/common/block_device.go index 47d683532..48d2a089a 100644 --- a/builder/amazon/common/block_device.go +++ b/builder/amazon/common/block_device.go @@ -181,11 +181,11 @@ func (b *BlockDevice) Prepare(ctx *interpolate.Context) error { return fmt.Errorf("%s: the maximum ratio of provisioned IOPS to requested volume size "+ "(in GiB) is %v:1 for %s volumes", b.DeviceName, ratio, b.VolumeType) } - } - if b.IOPS < minIops || b.IOPS > maxIops { - return fmt.Errorf("IOPS must be between %d and %d for device %s", - minIops, maxIops, b.DeviceName) + if b.IOPS < minIops || b.IOPS > maxIops { + return fmt.Errorf("IOPS must be between %d and %d for device %s", + minIops, maxIops, b.DeviceName) + } } _, err := interpolate.RenderInterface(&b, ctx)