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
97f52666
Unverified
Commit
97f52666
authored
Feb 15, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Feb 15, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74050 from huynq0911/fix_error_collide_package
Fix error collides with imported package name and log warning
parents
763042e9
7c923b64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
plugins.go
pkg/scheduler/factory/plugins.go
+10
-10
No files found.
pkg/scheduler/factory/plugins.go
View file @
97f52666
...
@@ -412,23 +412,23 @@ func getFitPredicateFunctions(names sets.String, args PluginFactoryArgs) (map[st
...
@@ -412,23 +412,23 @@ func getFitPredicateFunctions(names sets.String, args PluginFactoryArgs) (map[st
schedulerFactoryMutex
.
Lock
()
schedulerFactoryMutex
.
Lock
()
defer
schedulerFactoryMutex
.
Unlock
()
defer
schedulerFactoryMutex
.
Unlock
()
p
redicates
:=
map
[
string
]
predicates
.
FitPredicate
{}
fitP
redicates
:=
map
[
string
]
predicates
.
FitPredicate
{}
for
_
,
name
:=
range
names
.
List
()
{
for
_
,
name
:=
range
names
.
List
()
{
factory
,
ok
:=
fitPredicateMap
[
name
]
factory
,
ok
:=
fitPredicateMap
[
name
]
if
!
ok
{
if
!
ok
{
return
nil
,
fmt
.
Errorf
(
"
I
nvalid predicate name %q specified - no corresponding function found"
,
name
)
return
nil
,
fmt
.
Errorf
(
"
i
nvalid predicate name %q specified - no corresponding function found"
,
name
)
}
}
p
redicates
[
name
]
=
factory
(
args
)
fitP
redicates
[
name
]
=
factory
(
args
)
}
}
// Always include mandatory fit predicates.
// Always include mandatory fit predicates.
for
name
:=
range
mandatoryFitPredicates
{
for
name
:=
range
mandatoryFitPredicates
{
if
factory
,
found
:=
fitPredicateMap
[
name
];
found
{
if
factory
,
found
:=
fitPredicateMap
[
name
];
found
{
p
redicates
[
name
]
=
factory
(
args
)
fitP
redicates
[
name
]
=
factory
(
args
)
}
}
}
}
return
p
redicates
,
nil
return
fitP
redicates
,
nil
}
}
func
getPriorityMetadataProducer
(
args
PluginFactoryArgs
)
(
priorities
.
PriorityMetadataProducer
,
error
)
{
func
getPriorityMetadataProducer
(
args
PluginFactoryArgs
)
(
priorities
.
PriorityMetadataProducer
,
error
)
{
...
@@ -455,11 +455,11 @@ func getPriorityFunctionConfigs(names sets.String, args PluginFactoryArgs) ([]pr
...
@@ -455,11 +455,11 @@ func getPriorityFunctionConfigs(names sets.String, args PluginFactoryArgs) ([]pr
schedulerFactoryMutex
.
Lock
()
schedulerFactoryMutex
.
Lock
()
defer
schedulerFactoryMutex
.
Unlock
()
defer
schedulerFactoryMutex
.
Unlock
()
configs
:=
[]
priorities
.
PriorityConfig
{}
var
configs
[]
priorities
.
PriorityConfig
for
_
,
name
:=
range
names
.
List
()
{
for
_
,
name
:=
range
names
.
List
()
{
factory
,
ok
:=
priorityFunctionMap
[
name
]
factory
,
ok
:=
priorityFunctionMap
[
name
]
if
!
ok
{
if
!
ok
{
return
nil
,
fmt
.
Errorf
(
"
I
nvalid priority name %s specified - no corresponding function found"
,
name
)
return
nil
,
fmt
.
Errorf
(
"
i
nvalid priority name %s specified - no corresponding function found"
,
name
)
}
}
if
factory
.
Function
!=
nil
{
if
factory
.
Function
!=
nil
{
configs
=
append
(
configs
,
priorities
.
PriorityConfig
{
configs
=
append
(
configs
,
priorities
.
PriorityConfig
{
...
@@ -489,7 +489,7 @@ func validateSelectedConfigs(configs []priorities.PriorityConfig) error {
...
@@ -489,7 +489,7 @@ func validateSelectedConfigs(configs []priorities.PriorityConfig) error {
for
_
,
config
:=
range
configs
{
for
_
,
config
:=
range
configs
{
// Checks totalPriority against MaxTotalPriority to avoid overflow
// Checks totalPriority against MaxTotalPriority to avoid overflow
if
config
.
Weight
*
schedulerapi
.
MaxPriority
>
schedulerapi
.
MaxTotalPriority
-
totalPriority
{
if
config
.
Weight
*
schedulerapi
.
MaxPriority
>
schedulerapi
.
MaxTotalPriority
-
totalPriority
{
return
fmt
.
Errorf
(
"
T
otal priority of priority functions has overflown"
)
return
fmt
.
Errorf
(
"
t
otal priority of priority functions has overflown"
)
}
}
totalPriority
+=
config
.
Weight
*
schedulerapi
.
MaxPriority
totalPriority
+=
config
.
Weight
*
schedulerapi
.
MaxPriority
}
}
...
@@ -542,7 +542,7 @@ func ListRegisteredFitPredicates() []string {
...
@@ -542,7 +542,7 @@ func ListRegisteredFitPredicates() []string {
schedulerFactoryMutex
.
Lock
()
schedulerFactoryMutex
.
Lock
()
defer
schedulerFactoryMutex
.
Unlock
()
defer
schedulerFactoryMutex
.
Unlock
()
names
:=
[]
string
{}
var
names
[]
string
for
name
:=
range
fitPredicateMap
{
for
name
:=
range
fitPredicateMap
{
names
=
append
(
names
,
name
)
names
=
append
(
names
,
name
)
}
}
...
@@ -554,7 +554,7 @@ func ListRegisteredPriorityFunctions() []string {
...
@@ -554,7 +554,7 @@ func ListRegisteredPriorityFunctions() []string {
schedulerFactoryMutex
.
Lock
()
schedulerFactoryMutex
.
Lock
()
defer
schedulerFactoryMutex
.
Unlock
()
defer
schedulerFactoryMutex
.
Unlock
()
names
:=
[]
string
{}
var
names
[]
string
for
name
:=
range
priorityFunctionMap
{
for
name
:=
range
priorityFunctionMap
{
names
=
append
(
names
,
name
)
names
=
append
(
names
,
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