re-init proxywatcher on empty proxy list

This commit is contained in:
Forrest Marshall 2020-07-23 11:55:54 -07:00 committed by Forrest Marshall
parent 1613979ee3
commit e9326d7370

View file

@ -237,6 +237,11 @@ func (p *ProxyWatcher) watch() error {
if err != nil {
return trace.Wrap(err)
}
if len(proxies) == 0 {
// at least 1 proxy aught to exist; yield back to the outer
// retry loop and try again.
return trace.NotFound("empty proxy list")
}
proxySet := make(map[string]Server, len(proxies))
for i := range proxies {
proxySet[proxies[i].GetName()] = proxies[i]