simplify code flow: skip the step if no run_volume_tags provided
This commit is contained in:
parent
a65af51a4b
commit
ae016a1f25
|
@ -18,7 +18,9 @@ func (s *stepTagEBSVolumes) Run(state multistep.StateBag) multistep.StepAction {
|
||||||
instance := state.Get("instance").(*ec2.Instance)
|
instance := state.Get("instance").(*ec2.Instance)
|
||||||
ui := state.Get("ui").(packer.Ui)
|
ui := state.Get("ui").(packer.Ui)
|
||||||
|
|
||||||
if len(s.VolumeRunTags) > 0 {
|
if len(s.VolumeRunTags) == 0 {
|
||||||
|
return multistep.ActionContinue
|
||||||
|
}
|
||||||
|
|
||||||
volumeIds := make([]*string, 0)
|
volumeIds := make([]*string, 0)
|
||||||
for _, v := range instance.BlockDeviceMappings {
|
for _, v := range instance.BlockDeviceMappings {
|
||||||
|
@ -46,7 +48,6 @@ func (s *stepTagEBSVolumes) Run(state multistep.StateBag) multistep.StepAction {
|
||||||
ui.Error(err.Error())
|
ui.Error(err.Error())
|
||||||
return multistep.ActionHalt
|
return multistep.ActionHalt
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return multistep.ActionContinue
|
return multistep.ActionContinue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue