Merge pull request #2201 from janschumann/ebs_volume_creation_fails_without_volume_type
EBS volume creation fails without volume type
This commit is contained in:
commit
5c8d973563
|
@ -35,7 +35,7 @@ func buildBlockDevices(b []BlockDevice) []*ec2.BlockDeviceMapping {
|
||||||
}
|
}
|
||||||
|
|
||||||
// IOPS is only valid for SSD Volumes
|
// IOPS is only valid for SSD Volumes
|
||||||
if blockDevice.VolumeType != "standard" && blockDevice.VolumeType != "gp2" {
|
if blockDevice.VolumeType != "" && blockDevice.VolumeType != "standard" && blockDevice.VolumeType != "gp2" {
|
||||||
ebsBlockDevice.IOPS = &blockDevice.IOPS
|
ebsBlockDevice.IOPS = &blockDevice.IOPS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,23 @@ func TestBlockDevice(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Config: &BlockDevice{
|
||||||
|
DeviceName: "/dev/sdb",
|
||||||
|
VolumeSize: 8,
|
||||||
|
},
|
||||||
|
|
||||||
|
Result: &ec2.BlockDeviceMapping{
|
||||||
|
DeviceName: aws.String("/dev/sdb"),
|
||||||
|
VirtualName: aws.String(""),
|
||||||
|
EBS: &ec2.EBSBlockDevice{
|
||||||
|
Encrypted: aws.Boolean(false),
|
||||||
|
VolumeType: aws.String(""),
|
||||||
|
VolumeSize: aws.Long(8),
|
||||||
|
DeleteOnTermination: aws.Boolean(false),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Config: &BlockDevice{
|
Config: &BlockDevice{
|
||||||
DeviceName: "/dev/sdb",
|
DeviceName: "/dev/sdb",
|
||||||
|
|
Loading…
Reference in New Issue