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
623e7dfa
Commit
623e7dfa
authored
Jun 03, 2016
by
Abhishek Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Considering all nodes for the scheduler cache to allow lookups
parent
e79f0469
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
factory.go
plugin/pkg/scheduler/factory/factory.go
+9
-3
No files found.
plugin/pkg/scheduler/factory/factory.go
View file @
623e7dfa
...
@@ -449,6 +449,11 @@ func getNodeConditionPredicate() cache.NodeConditionPredicate {
...
@@ -449,6 +449,11 @@ func getNodeConditionPredicate() cache.NodeConditionPredicate {
return
false
return
false
}
}
}
}
// Ignore nodes that are marked unschedulable
if
node
.
Spec
.
Unschedulable
{
glog
.
V
(
4
)
.
Infof
(
"Ignoring node %v since it is unschedulable"
,
node
.
Name
)
return
false
}
return
true
return
true
}
}
}
}
...
@@ -470,9 +475,10 @@ func (factory *ConfigFactory) createAssignedNonTerminatedPodLW() *cache.ListWatc
...
@@ -470,9 +475,10 @@ func (factory *ConfigFactory) createAssignedNonTerminatedPodLW() *cache.ListWatc
// createNodeLW returns a cache.ListWatch that gets all changes to nodes.
// createNodeLW returns a cache.ListWatch that gets all changes to nodes.
func
(
factory
*
ConfigFactory
)
createNodeLW
()
*
cache
.
ListWatch
{
func
(
factory
*
ConfigFactory
)
createNodeLW
()
*
cache
.
ListWatch
{
// TODO: Filter out nodes that doesn't have NodeReady condition.
// all nodes are considered to ensure that the scheduler cache has access to all nodes for lookups
fields
:=
fields
.
Set
{
api
.
NodeUnschedulableField
:
"false"
}
.
AsSelector
()
// the NodeCondition is used to filter out the nodes that are not ready or unschedulable
return
cache
.
NewListWatchFromClient
(
factory
.
Client
,
"nodes"
,
api
.
NamespaceAll
,
fields
)
// the filtered list is used as the super set of nodes to consider for scheduling
return
cache
.
NewListWatchFromClient
(
factory
.
Client
,
"nodes"
,
api
.
NamespaceAll
,
fields
.
ParseSelectorOrDie
(
""
))
}
}
// createPersistentVolumeLW returns a cache.ListWatch that gets all changes to persistentVolumes.
// createPersistentVolumeLW returns a cache.ListWatch that gets all changes to persistentVolumes.
...
...
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