Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
5067af15
Commit
5067af15
authored
Jul 11, 2016
by
k8s-merge-robot
Committed by
GitHub
Jul 11, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #28715 from euank/kubelet-trim-dead-code
Automatic merge from submit-queue kubelete: delete a few bits of dead code Less is more.
parents
0aa90bd6
eeee8b54
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
31 deletions
+2
-31
kubelet.go
pkg/kubelet/kubelet.go
+0
-13
kubelet_test.go
pkg/kubelet/kubelet_test.go
+0
-11
pod_manager.go
pkg/kubelet/pod/pod_manager.go
+0
-5
predicates.go
plugin/pkg/scheduler/algorithm/predicates/predicates.go
+2
-2
No files found.
pkg/kubelet/kubelet.go
View file @
5067af15
...
...
@@ -2174,19 +2174,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
)
{
...
...
pkg/kubelet/kubelet_test.go
View file @
5067af15
...
...
@@ -22,7 +22,6 @@ import (
"io"
"io/ioutil"
"net"
"net/http"
"os"
"reflect"
goruntime
"runtime"
...
...
@@ -99,16 +98,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
...
...
pkg/kubelet/pod/pod_manager.go
View file @
5067af15
...
...
@@ -199,11 +199,6 @@ func (pm *basicManager) GetPodsAndMirrorPods() ([]*api.Pod, []*api.Pod) {
return
pods
,
mirrorPods
}
// Returns all pods (including mirror pods).
func
(
pm
*
basicManager
)
getAllPods
()
[]
*
api
.
Pod
{
return
append
(
podsMapToPods
(
pm
.
podByUID
),
podsMapToPods
(
pm
.
mirrorPodByUID
)
...
)
}
func
(
pm
*
basicManager
)
GetPodByUID
(
uid
types
.
UID
)
(
*
api
.
Pod
,
bool
)
{
pm
.
lock
.
RLock
()
defer
pm
.
lock
.
RUnlock
()
...
...
plugin/pkg/scheduler/algorithm/predicates/predicates.go
View file @
5067af15
...
...
@@ -533,7 +533,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
P
odMatchesNodeLabels
(
pod
*
api
.
Pod
,
node
*
api
.
Node
)
bool
{
func
p
odMatchesNodeLabels
(
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
)
...
...
@@ -590,7 +590,7 @@ func PodSelectorMatches(pod *api.Pod, meta interface{}, nodeInfo *schedulercache
if
node
==
nil
{
return
false
,
fmt
.
Errorf
(
"node not found"
)
}
if
P
odMatchesNodeLabels
(
pod
,
node
)
{
if
p
odMatchesNodeLabels
(
pod
,
node
)
{
return
true
,
nil
}
return
false
,
ErrNodeSelectorNotMatch
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment