mirror of https://github.com/k3s-io/k3s
Start endpoint tunnel watch before waiting
parent
2d32337334
commit
b93b4732eb
|
@ -83,7 +83,6 @@ func Setup(config *config.Node) error {
|
||||||
disconnect[address] = connect(wg, address, config, transportConfig)
|
disconnect[address] = connect(wg, address, config, transportConfig)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wg.Wait()
|
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
connect:
|
connect:
|
||||||
|
@ -134,6 +133,8 @@ func Setup(config *config.Node) error {
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
wg.Wait()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,6 +179,9 @@ func connect(waitGroup *sync.WaitGroup, address string, config *config.Node, tra
|
||||||
})
|
})
|
||||||
|
|
||||||
if ctx.Err() != nil {
|
if ctx.Err() != nil {
|
||||||
|
if waitGroup != nil {
|
||||||
|
once.Do(waitGroup.Done)
|
||||||
|
}
|
||||||
logrus.Infof("Stopped tunnel to %s", wsURL)
|
logrus.Infof("Stopped tunnel to %s", wsURL)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue