Commit 5c8d9735 authored by Clint's avatar Clint

Merge pull request #2201 from janschumann/ebs_volume_creation_fails_without_volume_type

EBS volume creation fails without volume type
parents 2a6c4e0d 802cfa38
...@@ -35,7 +35,7 @@ func buildBlockDevices(b []BlockDevice) []*ec2.BlockDeviceMapping { ...@@ -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) { ...@@ -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",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment