From c57485c78d6bed8bf9ceeb79e054b624d9ce9fea Mon Sep 17 00:00:00 2001 From: Matt Whittington Date: Mon, 13 Mar 2017 11:35:39 +1100 Subject: [PATCH] Misc fixes Add return after error in debug store handler. Pass interface rather than interface generator when registering pod and namespace handlers. --- cmd/k8s.go | 12 ++---------- cmd/server.go | 1 + 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/cmd/k8s.go b/cmd/k8s.go index e23cedab..adc95432 100644 --- a/cmd/k8s.go +++ b/cmd/k8s.go @@ -30,11 +30,7 @@ func (k8s *k8s) watchForPods(podManager kcache.ResourceEventHandler) kcache.Stor k8s.createPodLW(), &api.Pod{}, resyncPeriod, - kcache.ResourceEventHandlerFuncs{ - AddFunc: podManager.OnAdd, - DeleteFunc: podManager.OnDelete, - UpdateFunc: podManager.OnUpdate, - }, + podManager, ) go podController.Run(wait.NeverStop) return podStore @@ -50,11 +46,7 @@ func (k8s *k8s) watchForNamespaces(nsManager kcache.ResourceEventHandler) kcache k8s.createNamespaceLW(), &api.Namespace{}, resyncPeriod, - kcache.ResourceEventHandlerFuncs{ - AddFunc: nsManager.OnAdd, - DeleteFunc: nsManager.OnDelete, - UpdateFunc: nsManager.OnUpdate, - }, + nsManager, ) go nsController.Run(wait.NeverStop) return nsStore diff --git a/cmd/server.go b/cmd/server.go index a03eb3dd..e0c059ec 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -93,6 +93,7 @@ func (s *Server) debugStoreHandler(w http.ResponseWriter, r *http.Request) { if err != nil { log.Errorf("Error converting debug map to json: %+v", err) http.Error(w, err.Error(), http.StatusInternalServerError) + return } w.Write(o)