k8s: changed debug log, removed unneeded stop channels, increased watch channel buffer
This commit is contained in:
parent
d1e631a487
commit
7f4eddf6d6
2 changed files with 7 additions and 13 deletions
|
@ -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
|
// WatchAll returns events in the cluster and updates the stores via informer
|
||||||
// Filters ingresses by labelSelector
|
// Filters ingresses by labelSelector
|
||||||
func (c *clientImpl) WatchAll(labelSelector string, stopCh <-chan bool) (chan interface{}, error) {
|
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)
|
kubeLabelSelector, err := labels.Parse(labelSelector)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
stopIngresses := make(chan struct{})
|
chanIngresses := c.WatchIngresses(kubeLabelSelector, stopWatchCh)
|
||||||
chanIngresses := c.WatchIngresses(kubeLabelSelector, stopIngresses)
|
chanServices := c.WatchServices(stopWatchCh)
|
||||||
|
chanEndpoints := c.WatchEndpoints(stopWatchCh)
|
||||||
stopServices := make(chan struct{})
|
|
||||||
chanServices := c.WatchServices(stopServices)
|
|
||||||
|
|
||||||
stopEndpoints := make(chan struct{})
|
|
||||||
chanEndpoints := c.WatchEndpoints(stopEndpoints)
|
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
defer close(stopWatchCh)
|
||||||
defer close(watchCh)
|
defer close(watchCh)
|
||||||
defer close(stopIngresses)
|
|
||||||
defer close(stopServices)
|
|
||||||
defer close(stopEndpoints)
|
|
||||||
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
|
|
|
@ -78,7 +78,7 @@ func (provider *Kubernetes) Provide(configurationChan chan<- types.ConfigMessage
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if reflect.DeepEqual(provider.lastConfiguration.Get(), templateObjects) {
|
if reflect.DeepEqual(provider.lastConfiguration.Get(), templateObjects) {
|
||||||
log.Debug("Skipping event")
|
log.Debugf("Skipping event from kubernetes %+v", event)
|
||||||
} else {
|
} else {
|
||||||
provider.lastConfiguration.Set(templateObjects)
|
provider.lastConfiguration.Set(templateObjects)
|
||||||
configurationChan <- types.ConfigMessage{
|
configurationChan <- types.ConfigMessage{
|
||||||
|
|
Loading…
Reference in a new issue