k8s: changed debug log, removed unneeded stop channels, increased watch channel buffer

This commit is contained in:
yvespp 2016-11-22 22:02:51 +01:00 committed by Yves Peter
parent d1e631a487
commit 7f4eddf6d6
2 changed files with 7 additions and 13 deletions

View file

@ -187,27 +187,21 @@ func (c *clientImpl) WatchEndpoints(stopCh <-chan struct{}) chan interface{} {
// WatchAll returns events in the cluster and updates the stores via informer
// Filters ingresses by labelSelector
func (c *clientImpl) WatchAll(labelSelector string, stopCh <-chan bool) (chan interface{}, error) {
watchCh := make(chan interface{}, 10)
watchCh := make(chan interface{}, 100)
stopWatchCh := make(chan struct{}, 1)
kubeLabelSelector, err := labels.Parse(labelSelector)
if err != nil {
return nil, err
}
stopIngresses := make(chan struct{})
chanIngresses := c.WatchIngresses(kubeLabelSelector, stopIngresses)
stopServices := make(chan struct{})
chanServices := c.WatchServices(stopServices)
stopEndpoints := make(chan struct{})
chanEndpoints := c.WatchEndpoints(stopEndpoints)
chanIngresses := c.WatchIngresses(kubeLabelSelector, stopWatchCh)
chanServices := c.WatchServices(stopWatchCh)
chanEndpoints := c.WatchEndpoints(stopWatchCh)
go func() {
defer close(stopWatchCh)
defer close(watchCh)
defer close(stopIngresses)
defer close(stopServices)
defer close(stopEndpoints)
for {
select {

View file

@ -78,7 +78,7 @@ func (provider *Kubernetes) Provide(configurationChan chan<- types.ConfigMessage
return err
}
if reflect.DeepEqual(provider.lastConfiguration.Get(), templateObjects) {
log.Debug("Skipping event")
log.Debugf("Skipping event from kubernetes %+v", event)
} else {
provider.lastConfiguration.Set(templateObjects)
configurationChan <- types.ConfigMessage{