mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 13:02:14 +00:00
Get rid of redundant parseSelectorOrDie
This commit is contained in:
parent
9e7ce8ddb3
commit
de8b958b2f
@ -922,7 +922,7 @@ func (ks *MesosScheduler) recoverTasks() error {
|
|||||||
// Create creates a scheduler plugin and all supporting background functions.
|
// Create creates a scheduler plugin and all supporting background functions.
|
||||||
func (k *MesosScheduler) NewDefaultPluginConfig(terminate <-chan struct{}, mux *http.ServeMux) *PluginConfig {
|
func (k *MesosScheduler) NewDefaultPluginConfig(terminate <-chan struct{}, mux *http.ServeMux) *PluginConfig {
|
||||||
// use ListWatch watching pods using the client by default
|
// 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)
|
return k.NewPluginConfig(terminate, mux, lw)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ import (
|
|||||||
apierrors "k8s.io/kubernetes/pkg/api/errors"
|
apierrors "k8s.io/kubernetes/pkg/api/errors"
|
||||||
"k8s.io/kubernetes/pkg/client/cache"
|
"k8s.io/kubernetes/pkg/client/cache"
|
||||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||||
"k8s.io/kubernetes/pkg/fields"
|
|
||||||
plugin "k8s.io/kubernetes/plugin/pkg/scheduler"
|
plugin "k8s.io/kubernetes/plugin/pkg/scheduler"
|
||||||
"k8s.io/kubernetes/plugin/pkg/scheduler/algorithm"
|
"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")
|
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
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user