Commit 034a8636 authored by Erik Wilson's avatar Erik Wilson

Cleanup remotedialer tunnel logs

parent c18e896a
...@@ -91,7 +91,7 @@ func Setup(config *config.Node) error { ...@@ -91,7 +91,7 @@ func Setup(config *config.Node) error {
FieldSelector: fields.Set{"metadata.name": "kubernetes"}.String(), FieldSelector: fields.Set{"metadata.name": "kubernetes"}.String(),
}) })
if err != nil { if err != nil {
logrus.Errorf("Unable to watch for endpoints: %v", err) logrus.Errorf("Unable to watch for tunnel endpoints: %v", err)
time.Sleep(5 * time.Second) time.Sleep(5 * time.Second)
continue connect continue connect
} }
...@@ -100,21 +100,24 @@ func Setup(config *config.Node) error { ...@@ -100,21 +100,24 @@ func Setup(config *config.Node) error {
select { select {
case ev, ok := <-watch.ResultChan(): case ev, ok := <-watch.ResultChan():
if !ok { if !ok {
logrus.Error("endpoint watch channel closed") logrus.Error("Tunnel endpoint watch channel closed")
continue connect continue connect
} }
endpoint, ok := ev.Object.(*v1.Endpoints) endpoint, ok := ev.Object.(*v1.Endpoints)
if !ok { if !ok {
logrus.Error("could not case event object to endpoint") logrus.Error("Tunnel could not case event object to endpoint")
continue watching continue watching
} }
validEndpoint := map[string]bool{}
var addresses = getAddresses(endpoint) var addresses = getAddresses(endpoint)
logrus.Infof("Tunnel endpoint watch event: %v", addresses)
validEndpoint := map[string]bool{}
for _, address := range addresses { for _, address := range addresses {
validEndpoint[address] = true validEndpoint[address] = true
if _, ok := disconnect[address]; !ok { if _, ok := disconnect[address]; !ok {
disconnect[address] = connect(wg, address, config, transportConfig) disconnect[address] = connect(nil, address, config, transportConfig)
} }
} }
...@@ -173,7 +176,7 @@ func connect(waitGroup *sync.WaitGroup, address string, config *config.Node, tra ...@@ -173,7 +176,7 @@ func connect(waitGroup *sync.WaitGroup, address string, config *config.Node, tra
}) })
if ctx.Err() != nil { if ctx.Err() != nil {
logrus.Infof("Stopping tunnel to %s", wsURL) logrus.Infof("Stopped tunnel to %s", wsURL)
return return
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment