fix panic that occurs when ami_block_device_mappings and does not explicitly contain the root volume
This commit is contained in:
parent
9bc0e17e1c
commit
5f92de6a39
|
@ -25,7 +25,8 @@ func (s *StepRegisterAMI) Run(state multistep.StateBag) multistep.StepAction {
|
|||
|
||||
ui.Say("Registering the AMI...")
|
||||
|
||||
blockDevicesExcludingRoot := make([]*ec2.BlockDeviceMapping, 0, len(s.BlockDevices)-1)
|
||||
// Defensive coding to make sure we only add the root volume once
|
||||
blockDevicesExcludingRoot := make([]*ec2.BlockDeviceMapping, 0, len(s.BlockDevices))
|
||||
for _, blockDevice := range s.BlockDevices {
|
||||
if *blockDevice.DeviceName == s.RootDevice.SourceDeviceName {
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue