kubelet: delete unused code

This commit is contained in:
Euan Kemp 2016-07-08 02:03:51 -07:00 committed by Euan Kemp
parent 2296108886
commit 26e0f50504
3 changed files with 2 additions and 26 deletions

View File

@ -2357,19 +2357,6 @@ func (kl *Kubelet) isOutOfDisk() bool {
return false
}
// matchesNodeSelector returns true if pod matches node's labels.
func (kl *Kubelet) matchesNodeSelector(pod *api.Pod) bool {
if kl.standaloneMode {
return true
}
node, err := kl.GetNode()
if err != nil {
glog.Errorf("error getting node: %v", err)
return false
}
return predicates.PodMatchesNodeLabels(pod, node)
}
// rejectPod records an event about the pod with the given reason and message,
// and updates the pod to the failed phase in the status manage.
func (kl *Kubelet) rejectPod(pod *api.Pod, reason, message string) {

View File

@ -22,7 +22,6 @@ import (
"io"
"io/ioutil"
"net"
"net/http"
"os"
"reflect"
goruntime "runtime"
@ -100,16 +99,6 @@ const (
maxImgSize int64 = 1000 * 1024 * 1024
)
type fakeHTTP struct {
url string
err error
}
func (f *fakeHTTP) Get(url string) (*http.Response, error) {
f.url = url
return nil, f.err
}
type TestKubelet struct {
kubelet *Kubelet
fakeRuntime *containertest.FakeRuntime

View File

@ -492,7 +492,7 @@ func nodeMatchesNodeSelectorTerms(node *api.Node, nodeSelectorTerms []api.NodeSe
}
// The pod can only schedule onto nodes that satisfy requirements in both NodeAffinity and nodeSelector.
func PodMatchesNodeLabels(pod *api.Pod, node *api.Node) bool {
func podMatchesNodeLabels(pod *api.Pod, node *api.Node) bool {
// Check if node.Labels match pod.Spec.NodeSelector.
if len(pod.Spec.NodeSelector) > 0 {
selector := labels.SelectorFromSet(pod.Spec.NodeSelector)
@ -549,7 +549,7 @@ func PodSelectorMatches(pod *api.Pod, nodeInfo *schedulercache.NodeInfo) (bool,
if node == nil {
return false, fmt.Errorf("node not found")
}
if PodMatchesNodeLabels(pod, node) {
if podMatchesNodeLabels(pod, node) {
return true, nil
}
return false, ErrNodeSelectorNotMatch