Remove unnecessary loop
This commit is contained in:
parent
e4a7375d34
commit
0861c59bec
1 changed files with 29 additions and 33 deletions
|
@ -122,7 +122,6 @@ func (p *Provider) Provide(configurationChan chan<- types.ConfigMessage, pool *s
|
||||||
|
|
||||||
pool.Go(func(stop chan bool) {
|
pool.Go(func(stop chan bool) {
|
||||||
operation := func() error {
|
operation := func() error {
|
||||||
for {
|
|
||||||
stopWatch := make(chan struct{}, 1)
|
stopWatch := make(chan struct{}, 1)
|
||||||
defer close(stopWatch)
|
defer close(stopWatch)
|
||||||
eventsChan, err := k8sClient.WatchAll(p.Namespaces, stopWatch)
|
eventsChan, err := k8sClient.WatchAll(p.Namespaces, stopWatch)
|
||||||
|
@ -142,12 +141,10 @@ func (p *Provider) Provide(configurationChan chan<- types.ConfigMessage, pool *s
|
||||||
return nil
|
return nil
|
||||||
case event := <-eventsChan:
|
case event := <-eventsChan:
|
||||||
log.Debugf("Received Kubernetes event kind %T", event)
|
log.Debugf("Received Kubernetes event kind %T", event)
|
||||||
|
|
||||||
templateObjects, err := p.loadIngresses(k8sClient)
|
templateObjects, err := p.loadIngresses(k8sClient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if reflect.DeepEqual(p.lastConfiguration.Get(), templateObjects) {
|
if reflect.DeepEqual(p.lastConfiguration.Get(), templateObjects) {
|
||||||
log.Debugf("Skipping Kubernetes event kind %T", event)
|
log.Debugf("Skipping Kubernetes event kind %T", event)
|
||||||
} else {
|
} else {
|
||||||
|
@ -160,7 +157,6 @@ func (p *Provider) Provide(configurationChan chan<- types.ConfigMessage, pool *s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
notify := func(err error, time time.Duration) {
|
notify := func(err error, time time.Duration) {
|
||||||
log.Errorf("Provider connection error: %s; retrying in %s", err, time)
|
log.Errorf("Provider connection error: %s; retrying in %s", err, time)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue