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
dd26cdf0
Commit
dd26cdf0
authored
Apr 10, 2015
by
Daniel Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix comments; switch to watching nodes
parent
66d55e09
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
11 deletions
+8
-11
controller.go
pkg/controller/framework/controller.go
+3
-1
controller_test.go
pkg/controller/framework/controller_test.go
+3
-2
factory.go
plugin/pkg/scheduler/factory/factory.go
+2
-8
No files found.
pkg/controller/framework/controller.go
View file @
dd26cdf0
...
...
@@ -115,7 +115,9 @@ func (c *Controller) processLoop() {
// get called even if nothing changed. This is useful for periodically
// evaluating or syncing something.
// * OnDelete will get the final state of the item if it is known, otherwise
// it will get an object of type cache.DeletedFinalStateUnknown.
// it will get an object of type cache.DeletedFinalStateUnknown. This can
// happen if the watch is closed and misses the delete event and we don't
// notice the deletion until the subsequent re-list.
type
ResourceEventHandler
interface
{
OnAdd
(
obj
interface
{})
OnUpdate
(
oldObj
,
newObj
interface
{})
...
...
pkg/controller/framework/controller_test.go
View file @
dd26cdf0
...
...
@@ -302,8 +302,9 @@ func TestUpdate(t *testing.T) {
var
testDoneWG
sync
.
WaitGroup
// Make a controller that immediately deletes anything added to it, and
// logs anything deleted.
// Make a controller that deletes things once it observes an update.
// It calls Done() on the wait group on deletions so we can tell when
// everything we've added has been deleted.
_
,
controller
:=
framework
.
NewInformer
(
source
,
&
api
.
Pod
{},
...
...
plugin/pkg/scheduler/factory/factory.go
View file @
dd26cdf0
...
...
@@ -168,13 +168,7 @@ func (f *ConfigFactory) CreateFromKeys(predicateKeys, priorityKeys util.StringSe
// Watch minions.
// Minions may be listed frequently, so provide a local up-to-date cache.
if
false
{
// Disable this code until minions support watches. Note when this code is enabled,
// we need to make sure minion ListWatcher has proper FieldSelector.
cache
.
NewReflector
(
f
.
createMinionLW
(),
&
api
.
Node
{},
f
.
NodeLister
.
Store
,
10
*
time
.
Second
)
.
RunUntil
(
f
.
StopEverything
)
}
else
{
cache
.
NewPoller
(
f
.
pollMinions
,
10
*
time
.
Second
,
f
.
NodeLister
.
Store
)
.
RunUntil
(
f
.
StopEverything
)
}
cache
.
NewReflector
(
f
.
createMinionLW
(),
&
api
.
Node
{},
f
.
NodeLister
.
Store
,
0
)
.
RunUntil
(
f
.
StopEverything
)
// Watch and cache all service objects. Scheduler needs to find all pods
// created by the same service, so that it can spread them correctly.
...
...
@@ -232,7 +226,7 @@ func (factory *ConfigFactory) createAssignedPodLW() *cache.ListWatch {
// createMinionLW returns a cache.ListWatch that gets all changes to minions.
func
(
factory
*
ConfigFactory
)
createMinionLW
()
*
cache
.
ListWatch
{
return
cache
.
NewListWatchFromClient
(
factory
.
Client
,
"
minion
s"
,
api
.
NamespaceAll
,
parseSelectorOrDie
(
""
))
return
cache
.
NewListWatchFromClient
(
factory
.
Client
,
"
node
s"
,
api
.
NamespaceAll
,
parseSelectorOrDie
(
""
))
}
// Lists all minions and filter out unhealthy ones, then returns
...
...
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