Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
autoscaler
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
kubernetes
autoscaler
Commits
c3b4362c
Commit
c3b4362c
authored
Dec 20, 2019
by
Łukasz Osipiuk
Browse files
Options
Downloads
Patches
Plain Diff
Drop IsNodeReadyAndSchedulablePredicate
It seems it is not needed any more
parent
8c1b7880
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cluster-autoscaler/simulator/predicates.go
+0
-14
0 additions, 14 deletions
cluster-autoscaler/simulator/predicates.go
with
0 additions
and
14 deletions
cluster-autoscaler/simulator/predicates.go
+
0
−
14
View file @
c3b4362c
...
...
@@ -21,8 +21,6 @@ import (
"strings"
"sync"
kube_util
"k8s.io/autoscaler/cluster-autoscaler/utils/kubernetes"
apiv1
"k8s.io/api/core/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
...
...
@@ -130,7 +128,6 @@ func NewPredicateChecker(kubeClient kube_client.Interface, stop <-chan struct{})
// We want to make sure that some predicates are present to run them first
// as they are cheap to check and they should be enough to fail predicates
// in most of our simulations (especially binpacking).
predicateMap
[
"ready"
]
=
IsNodeReadyAndSchedulablePredicate
if
_
,
found
:=
predicateMap
[
"PodFitsResources"
];
!
found
{
predicateMap
[
"PodFitsResources"
]
=
predicates
.
PodFitsResources
}
...
...
@@ -163,22 +160,11 @@ func NewPredicateChecker(kubeClient kube_client.Interface, stop <-chan struct{})
},
nil
}
// IsNodeReadyAndSchedulablePredicate checks if node is ready.
func
IsNodeReadyAndSchedulablePredicate
(
pod
*
apiv1
.
Pod
,
meta
predicates
.
Metadata
,
nodeInfo
*
schedulernodeinfo
.
NodeInfo
)
(
bool
,
[]
predicates
.
PredicateFailureReason
,
error
)
{
ready
:=
kube_util
.
IsNodeReadyAndSchedulable
(
nodeInfo
.
Node
())
if
!
ready
{
return
false
,
[]
predicates
.
PredicateFailureReason
{
predicates
.
NewPredicateFailureError
(
"IsNodeReadyAndSchedulablePredicate"
,
"node is unready"
)},
nil
}
return
true
,
[]
predicates
.
PredicateFailureReason
{},
nil
}
// NewTestPredicateChecker builds test version of PredicateChecker.
func
NewTestPredicateChecker
()
*
PredicateChecker
{
return
&
PredicateChecker
{
predicates
:
[]
PredicateInfo
{
{
Name
:
"default"
,
Predicate
:
predicates
.
GeneralPredicates
},
{
Name
:
"ready"
,
Predicate
:
IsNodeReadyAndSchedulablePredicate
},
},
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment