Ensure no goroutines leak from StepWaitForIP in concurrent cases

This commit is contained in:
Vladislav Rassokhin 2019-07-13 21:02:15 +03:00
parent b6cc2f01c7
commit 483df213fd
1 changed files with 5 additions and 0 deletions

View File

@ -43,6 +43,11 @@ func (s *StepWaitForIp) Run(ctx context.Context, state multistep.StateBag) multi
sub, cancel := context.WithCancel(ctx)
waitDone := make(chan bool, 1)
defer func() {
cancel()
for range waitDone {
}
}()
go func() {
ui.Say("Waiting for IP...")