mirror of https://github.com/k3s-io/k3s
Merge pull request #67464 from misterikkit/deadcode
Automatic merge from submit-queue (batch tested with PRs 67461, 67464, 67416). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Delete dead code in pkg/scheduler **What this PR does / why we need it**: This is just some cleanup. I found some unused code while evaluating the scheduler code. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ``` /kind cleanup /sig schedulingpull/8/head
commit
825548df95
|
@ -78,17 +78,16 @@ func (sched *Scheduler) StopEverything() {
|
|||
// construct a new scheduler. An implementation of this can be seen in
|
||||
// factory.go.
|
||||
type Configurator interface {
|
||||
GetPriorityFunctionConfigs(priorityKeys sets.String) ([]algorithm.PriorityConfig, error)
|
||||
GetPriorityMetadataProducer() (algorithm.PriorityMetadataProducer, error)
|
||||
GetPredicateMetadataProducer() (algorithm.PredicateMetadataProducer, error)
|
||||
GetPredicates(predicateKeys sets.String) (map[string]algorithm.FitPredicate, error)
|
||||
// Exposed for testing
|
||||
GetHardPodAffinitySymmetricWeight() int32
|
||||
GetSchedulerName() string
|
||||
// Exposed for testing
|
||||
MakeDefaultErrorFunc(backoff *util.PodBackoff, podQueue core.SchedulingQueue) func(pod *v1.Pod, err error)
|
||||
|
||||
// Needs to be exposed for things like integration tests where we want to make fake nodes.
|
||||
GetNodeLister() corelisters.NodeLister
|
||||
// Exposed for testing
|
||||
GetClient() clientset.Interface
|
||||
// Exposed for testing
|
||||
GetScheduledPodLister() corelisters.PodLister
|
||||
|
||||
Create() (*Config, error)
|
||||
|
|
|
@ -11,7 +11,6 @@ go_library(
|
|||
srcs = [
|
||||
"fake_cache.go",
|
||||
"fake_lister.go",
|
||||
"pods_to_cache.go",
|
||||
"util.go",
|
||||
],
|
||||
importpath = "k8s.io/kubernetes/pkg/scheduler/testing",
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
Copyright 2015 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package testing
|
||||
|
||||
import (
|
||||
"k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
schedulercache "k8s.io/kubernetes/pkg/scheduler/cache"
|
||||
)
|
||||
|
||||
// PodsToCache is used for testing
|
||||
type PodsToCache []*v1.Pod
|
||||
|
||||
// AssumePod returns nil.
|
||||
func (p PodsToCache) AssumePod(pod *v1.Pod) error { return nil }
|
||||
|
||||
// ForgetPod returns nil.
|
||||
func (p PodsToCache) ForgetPod(pod *v1.Pod) error { return nil }
|
||||
|
||||
// AddPod returns nil.
|
||||
func (p PodsToCache) AddPod(pod *v1.Pod) error { return nil }
|
||||
|
||||
// UpdatePod returns nil.
|
||||
func (p PodsToCache) UpdatePod(oldPod, newPod *v1.Pod) error { return nil }
|
||||
|
||||
// RemovePod returns nil.
|
||||
func (p PodsToCache) RemovePod(pod *v1.Pod) error { return nil }
|
||||
|
||||
// AddNode returns nil.
|
||||
func (p PodsToCache) AddNode(node *v1.Node) error { return nil }
|
||||
|
||||
// UpdateNode returns nil.
|
||||
func (p PodsToCache) UpdateNode(oldNode, newNode *v1.Node) error { return nil }
|
||||
|
||||
// RemoveNode returns nil.
|
||||
func (p PodsToCache) RemoveNode(node *v1.Node) error { return nil }
|
||||
|
||||
// UpdateNodeNameToInfoMap returns nil.
|
||||
func (p PodsToCache) UpdateNodeNameToInfoMap(infoMap map[string]*schedulercache.NodeInfo) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// List returns pods matching the label selector.
|
||||
func (p PodsToCache) List(s labels.Selector) (selected []*v1.Pod, err error) {
|
||||
for _, pod := range p {
|
||||
if s.Matches(labels.Set(pod.Labels)) {
|
||||
selected = append(selected, pod)
|
||||
}
|
||||
}
|
||||
return selected, nil
|
||||
}
|
|
@ -17,8 +17,6 @@ limitations under the License.
|
|||
package scheduler
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
clientset "k8s.io/client-go/kubernetes"
|
||||
|
@ -34,36 +32,11 @@ type FakeConfigurator struct {
|
|||
Config *Config
|
||||
}
|
||||
|
||||
// GetPriorityFunctionConfigs is not implemented yet.
|
||||
func (fc *FakeConfigurator) GetPriorityFunctionConfigs(priorityKeys sets.String) ([]algorithm.PriorityConfig, error) {
|
||||
return nil, fmt.Errorf("not implemented")
|
||||
}
|
||||
|
||||
// GetPriorityMetadataProducer is not implemented yet.
|
||||
func (fc *FakeConfigurator) GetPriorityMetadataProducer() (algorithm.PriorityMetadataProducer, error) {
|
||||
return nil, fmt.Errorf("not implemented")
|
||||
}
|
||||
|
||||
// GetPredicateMetadataProducer is not implemented yet.
|
||||
func (fc *FakeConfigurator) GetPredicateMetadataProducer() (algorithm.PredicateMetadataProducer, error) {
|
||||
return nil, fmt.Errorf("not implemented")
|
||||
}
|
||||
|
||||
// GetPredicates is not implemented yet.
|
||||
func (fc *FakeConfigurator) GetPredicates(predicateKeys sets.String) (map[string]algorithm.FitPredicate, error) {
|
||||
return nil, fmt.Errorf("not implemented")
|
||||
}
|
||||
|
||||
// GetHardPodAffinitySymmetricWeight is not implemented yet.
|
||||
func (fc *FakeConfigurator) GetHardPodAffinitySymmetricWeight() int32 {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
// GetSchedulerName is not implemented yet.
|
||||
func (fc *FakeConfigurator) GetSchedulerName() string {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
// MakeDefaultErrorFunc is not implemented yet.
|
||||
func (fc *FakeConfigurator) MakeDefaultErrorFunc(backoff *util.PodBackoff, podQueue core.SchedulingQueue) func(pod *v1.Pod, err error) {
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue