From 9e7ce8ddb3e18d5dae0770a4976e57f473766ef8 Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Mon, 26 Oct 2015 14:13:56 -0500 Subject: [PATCH] Remove redundant createAllPodsLW --- contrib/mesos/pkg/scheduler/mesos_scheduler.go | 3 ++- contrib/mesos/pkg/scheduler/plugin.go | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/contrib/mesos/pkg/scheduler/mesos_scheduler.go b/contrib/mesos/pkg/scheduler/mesos_scheduler.go index 73354d0625b..864ea3f061a 100644 --- a/contrib/mesos/pkg/scheduler/mesos_scheduler.go +++ b/contrib/mesos/pkg/scheduler/mesos_scheduler.go @@ -922,7 +922,8 @@ func (ks *MesosScheduler) recoverTasks() error { // Create creates a scheduler plugin and all supporting background functions. func (k *MesosScheduler) NewDefaultPluginConfig(terminate <-chan struct{}, mux *http.ServeMux) *PluginConfig { // use ListWatch watching pods using the client by default - return k.NewPluginConfig(terminate, mux, createAllPodsLW(k.client)) + lw := cache.NewListWatchFromClient(k.client, "pods", api.NamespaceAll, parseSelectorOrDie("")) + return k.NewPluginConfig(terminate, mux, lw) } func (k *MesosScheduler) NewPluginConfig(terminate <-chan struct{}, mux *http.ServeMux, diff --git a/contrib/mesos/pkg/scheduler/plugin.go b/contrib/mesos/pkg/scheduler/plugin.go index 6289068b68e..046a31c5cfc 100644 --- a/contrib/mesos/pkg/scheduler/plugin.go +++ b/contrib/mesos/pkg/scheduler/plugin.go @@ -354,9 +354,3 @@ func parseSelectorOrDie(s string) fields.Selector { } return selector } - -// createAllPodsLW returns a listWatch that finds all pods -func createAllPodsLW(cl *client.Client) *cache.ListWatch { - return cache.NewListWatchFromClient(cl, "pods", api.NamespaceAll, parseSelectorOrDie("")) -} -