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
6f5d40e5
Commit
6f5d40e5
authored
Nov 04, 2015
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename ReconcilerAction -> Action
parent
06a975e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
framework.go
...rib/mesos/pkg/scheduler/components/framework/framework.go
+8
-8
tasksreconciler.go
...g/scheduler/components/tasksreconciler/tasksreconciler.go
+3
-3
No files found.
contrib/mesos/pkg/scheduler/components/framework/framework.go
View file @
6f5d40e5
...
...
@@ -573,14 +573,14 @@ func explicitTaskFilter(t *podtask.T) bool {
// invoke the given ReconcilerAction funcs in sequence, aborting the sequence if reconciliation
// is cancelled. if any other errors occur the composite reconciler will attempt to complete the
// sequence, reporting only the last generated error.
func
(
k
*
framework
)
makeCompositeReconciler
(
actions
...
taskreconciler
.
ReconcilerAction
)
taskreconciler
.
Reconciler
Action
{
func
(
k
*
framework
)
makeCompositeReconciler
(
actions
...
taskreconciler
.
Action
)
taskreconciler
.
Action
{
if
x
:=
len
(
actions
);
x
==
0
{
// programming error
panic
(
"no actions specified for composite reconciler"
)
}
else
if
x
==
1
{
return
actions
[
0
]
}
chained
:=
func
(
d
bindings
.
SchedulerDriver
,
c
<-
chan
struct
{},
a
,
b
taskreconciler
.
Reconciler
Action
)
<-
chan
error
{
chained
:=
func
(
d
bindings
.
SchedulerDriver
,
c
<-
chan
struct
{},
a
,
b
taskreconciler
.
Action
)
<-
chan
error
{
ech
:=
a
(
d
,
c
)
ch
:=
make
(
chan
error
,
1
)
go
func
()
{
...
...
@@ -615,17 +615,17 @@ func (k *framework) makeCompositeReconciler(actions ...taskreconciler.Reconciler
for
i
:=
2
;
i
<
len
(
actions
);
i
++
{
i
:=
i
next
:=
func
(
d
bindings
.
SchedulerDriver
,
c
<-
chan
struct
{})
<-
chan
error
{
return
chained
(
d
,
c
,
taskreconciler
.
Reconciler
Action
(
result
),
actions
[
i
])
return
chained
(
d
,
c
,
taskreconciler
.
Action
(
result
),
actions
[
i
])
}
result
=
next
}
return
taskreconciler
.
Reconciler
Action
(
result
)
return
taskreconciler
.
Action
(
result
)
}
// reconciler action factory, performs explicit task reconciliation for non-terminal
// tasks listed in the scheduler's internal taskRegistry.
func
(
k
*
framework
)
makeTaskRegistryReconciler
()
taskreconciler
.
Reconciler
Action
{
return
taskreconciler
.
Reconciler
Action
(
func
(
drv
bindings
.
SchedulerDriver
,
cancel
<-
chan
struct
{})
<-
chan
error
{
func
(
k
*
framework
)
makeTaskRegistryReconciler
()
taskreconciler
.
Action
{
return
taskreconciler
.
Action
(
func
(
drv
bindings
.
SchedulerDriver
,
cancel
<-
chan
struct
{})
<-
chan
error
{
taskToSlave
:=
make
(
map
[
string
]
string
)
for
_
,
t
:=
range
k
.
sched
.
Tasks
()
.
List
(
explicitTaskFilter
)
{
if
t
.
Spec
.
SlaveID
!=
""
{
...
...
@@ -638,8 +638,8 @@ func (k *framework) makeTaskRegistryReconciler() taskreconciler.ReconcilerAction
// reconciler action factory, performs explicit task reconciliation for non-terminal
// tasks identified by annotations in the Kubernetes pod registry.
func
(
k
*
framework
)
makePodRegistryReconciler
()
taskreconciler
.
Reconciler
Action
{
return
taskreconciler
.
Reconciler
Action
(
func
(
drv
bindings
.
SchedulerDriver
,
cancel
<-
chan
struct
{})
<-
chan
error
{
func
(
k
*
framework
)
makePodRegistryReconciler
()
taskreconciler
.
Action
{
return
taskreconciler
.
Action
(
func
(
drv
bindings
.
SchedulerDriver
,
cancel
<-
chan
struct
{})
<-
chan
error
{
podList
,
err
:=
k
.
client
.
Pods
(
api
.
NamespaceAll
)
.
List
(
labels
.
Everything
(),
fields
.
Everything
())
if
err
!=
nil
{
return
proc
.
ErrorChanf
(
"failed to reconcile pod registry: %v"
,
err
)
...
...
contrib/mesos/pkg/scheduler/components/tasksreconciler/tasksreconciler.go
View file @
6f5d40e5
...
...
@@ -27,7 +27,7 @@ import (
"k8s.io/kubernetes/contrib/mesos/pkg/scheduler/metrics"
)
type
Reconciler
Action
func
(
driver
bindings
.
SchedulerDriver
,
cancel
<-
chan
struct
{})
<-
chan
error
type
Action
func
(
driver
bindings
.
SchedulerDriver
,
cancel
<-
chan
struct
{})
<-
chan
error
type
TasksReconciler
interface
{
RequestExplicit
()
...
...
@@ -37,14 +37,14 @@ type TasksReconciler interface {
type
tasksReconciler
struct
{
proc
.
Doer
Action
Reconciler
Action
Action
Action
explicit
chan
struct
{}
// send an empty struct to trigger explicit reconciliation
implicit
chan
struct
{}
// send an empty struct to trigger implicit reconciliation
cooldown
time
.
Duration
explicitReconciliationAbortTimeout
time
.
Duration
}
func
New
(
doer
proc
.
Doer
,
action
Reconciler
Action
,
func
New
(
doer
proc
.
Doer
,
action
Action
,
cooldown
,
explicitReconciliationAbortTimeout
time
.
Duration
,
done
<-
chan
struct
{})
TasksReconciler
{
return
&
tasksReconciler
{
Doer
:
doer
,
...
...
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