Get rid of redundant parseSelectorOrDie

This commit is contained in:
Dr. Stefan Schimanski 2015-10-26 14:16:18 -05:00
parent 9e7ce8ddb3
commit de8b958b2f
2 changed files with 1 additions and 10 deletions

View File

@ -922,7 +922,7 @@ 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
lw := cache.NewListWatchFromClient(k.client, "pods", api.NamespaceAll, parseSelectorOrDie(""))
lw := cache.NewListWatchFromClient(k.client, "pods", api.NamespaceAll, fields.Everything())
return k.NewPluginConfig(terminate, mux, lw)
}

View File

@ -37,7 +37,6 @@ import (
apierrors "k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/client/cache"
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/fields"
plugin "k8s.io/kubernetes/plugin/pkg/scheduler"
"k8s.io/kubernetes/plugin/pkg/scheduler/algorithm"
)
@ -346,11 +345,3 @@ func (s *schedulerPlugin) reconcileTask(t *podtask.T) {
log.Error("pod reconciliation does not support updates; not yet implemented")
}
}
func parseSelectorOrDie(s string) fields.Selector {
selector, err := fields.ParseSelector(s)
if err != nil {
panic(err)
}
return selector
}