don't abort on a single error if another availability zone was able to create the instance

pull/8184/head
Megan Marsh 7 years ago
parent c138edcbe1
commit e16fb19bfc

@ -274,15 +274,20 @@ func (s *StepRunSpotInstance) Run(ctx context.Context, state multistep.StateBag)
return multistep.ActionHalt return multistep.ActionHalt
} }
if len(createOutput.Errors) > 0 { if len(createOutput.Instances) == 0 {
errString := fmt.Sprintf("Error waiting for fleet request (%s) to become ready:", *createOutput.FleetId) // We can end up with errors because one of the allowed availability
for _, outErr := range createOutput.Errors { // zones doesn't have one of the allowed instance types; as long as
errString = errString + fmt.Sprintf("%s", *outErr.ErrorMessage) // an instance is launched, these errors aren't important.
if len(createOutput.Errors) > 0 {
errString := fmt.Sprintf("Error waiting for fleet request (%s) to become ready:", *createOutput.FleetId)
for _, outErr := range createOutput.Errors {
errString = errString + fmt.Sprintf("%s", *outErr.ErrorMessage)
}
err = fmt.Errorf(errString)
state.Put("error", err)
ui.Error(err.Error())
return multistep.ActionHalt
} }
err = fmt.Errorf(errString)
state.Put("error", err)
ui.Error(err.Error())
return multistep.ActionHalt
} }
instanceId = *createOutput.Instances[0].InstanceIds[0] instanceId = *createOutput.Instances[0].InstanceIds[0]

Loading…
Cancel
Save