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
eb22c8c1
Commit
eb22c8c1
authored
Feb 09, 2016
by
James DeFelice
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle nil *api.Node in procurement and added TODO for a better long term fix
parent
ee54afc9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
scheduler.go
contrib/mesos/pkg/scheduler/components/scheduler.go
+3
-0
procurement.go
contrib/mesos/pkg/scheduler/podtask/procurement.go
+4
-1
No files found.
contrib/mesos/pkg/scheduler/components/scheduler.go
View file @
eb22c8c1
...
...
@@ -99,6 +99,9 @@ func New(
// "backs off" when it can't find an offer that matches up with a pod.
// The backoff period for a pod can terminate sooner if an offer becomes
// available that matches up.
// TODO(jdef) this will never match for a pod that uses a node selector,
// since we're passing a nil *api.Node here.
return
!
task
.
Has
(
podtask
.
Launched
)
&&
ps
.
Fit
(
task
,
offer
,
nil
)
default
:
// no point in continuing to check for matching offers
...
...
contrib/mesos/pkg/scheduler/podtask/procurement.go
View file @
eb22c8c1
...
...
@@ -61,6 +61,8 @@ func NewDefaultProcurement(prototype *mesos.ExecutorInfo, eir executorinfo.Regis
//
// In contrast T.Spec is meant not to be filled by the procurement chain
// but rather by a final scheduler instance.
//
// api.Node is an optional (possibly nil) param.
type
Procurement
interface
{
Procure
(
*
T
,
*
api
.
Node
,
*
ProcureState
)
error
}
...
...
@@ -129,7 +131,8 @@ func NewNodeProcurement() Procurement {
// check the NodeSelector
if
len
(
t
.
Pod
.
Spec
.
NodeSelector
)
>
0
{
if
n
.
Labels
==
nil
{
// *api.Node is optional for procurement
if
n
==
nil
||
n
.
Labels
==
nil
{
return
fmt
.
Errorf
(
"NodeSelector %v does not match empty labels of pod %s/%s"
,
t
.
Pod
.
Spec
.
NodeSelector
,
t
.
Pod
.
Namespace
,
t
.
Pod
.
Name
,
...
...
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