Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1782847: sdn: undo debug logging #84

Merged
merged 1 commit into from Dec 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 0 additions & 27 deletions pkg/openshift-sdn/informers.go
@@ -1,7 +1,6 @@
package openshift_sdn

import (
"fmt"
"net"
"net/http"
"time"
Expand All @@ -15,7 +14,6 @@ import (
kinformers "k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/klog"
"k8s.io/kubernetes/pkg/proxy/apis"
)

Expand Down Expand Up @@ -69,9 +67,6 @@ func (sdn *OpenShiftSDN) buildInformers() error {

networkInformers := networkinformers.NewSharedInformerFactory(networkClient, defaultInformerResyncPeriod)

kubeInformers.Core().V1().Services().Informer().AddEventHandler(eventHandlingLogger{})
kubeInformers.Core().V1().Endpoints().Informer().AddEventHandler(eventHandlingLogger{})

sdn.informers = &informers{
KubeClient: kubeClient,
NetworkClient: networkClient,
Expand Down Expand Up @@ -125,25 +120,3 @@ func applyClientConnectionOverrides(kubeConfig *rest.Config) {
kubeConfig.QPS = 10.0
kubeConfig.Burst = 20
}

type eventHandlingLogger struct{}

func describe(obj interface{}) string {
if svc, ok := obj.(*v1.Service); ok {
return fmt.Sprintf("%+v", svc)
} else if ep, ok := obj.(*v1.Endpoints); ok {
return fmt.Sprintf("%+v", ep)
} else {
return fmt.Sprintf("%T", obj)
}
}

func (eventHandlingLogger) OnAdd(obj interface{}) {
klog.Infof("ADD %s", describe(obj))
}
func (eventHandlingLogger) OnUpdate(oldObj, newObj interface{}) {
klog.Infof("UPDATE %s -> %s", describe(oldObj), describe(newObj))
}
func (eventHandlingLogger) OnDelete(obj interface{}) {
klog.Infof("DELETE %s", describe(obj))
}