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
57c0e417
Commit
57c0e417
authored
Aug 23, 2018
by
Maciej Borsz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WaitForAllNodesSchedulable should check taints as well
parent
459b5378
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
BUILD
test/e2e/framework/BUILD
+1
-0
util.go
test/e2e/framework/util.go
+13
-3
No files found.
test/e2e/framework/BUILD
View file @
57c0e417
...
@@ -60,6 +60,7 @@ go_library(
...
@@ -60,6 +60,7 @@ go_library(
"//pkg/controller:go_default_library",
"//pkg/controller:go_default_library",
"//pkg/controller/deployment/util:go_default_library",
"//pkg/controller/deployment/util:go_default_library",
"//pkg/controller/nodelifecycle:go_default_library",
"//pkg/controller/nodelifecycle:go_default_library",
"//pkg/controller/service:go_default_library",
"//pkg/features:go_default_library",
"//pkg/features:go_default_library",
"//pkg/kubelet/apis:go_default_library",
"//pkg/kubelet/apis:go_default_library",
"//pkg/kubelet/apis/kubeletconfig:go_default_library",
"//pkg/kubelet/apis/kubeletconfig:go_default_library",
...
...
test/e2e/framework/util.go
View file @
57c0e417
...
@@ -87,6 +87,7 @@ import (
...
@@ -87,6 +87,7 @@ import (
gcecloud
"k8s.io/kubernetes/pkg/cloudprovider/providers/gce"
gcecloud
"k8s.io/kubernetes/pkg/cloudprovider/providers/gce"
"k8s.io/kubernetes/pkg/controller"
"k8s.io/kubernetes/pkg/controller"
nodectlr
"k8s.io/kubernetes/pkg/controller/nodelifecycle"
nodectlr
"k8s.io/kubernetes/pkg/controller/nodelifecycle"
"k8s.io/kubernetes/pkg/controller/service"
"k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/features"
kubeletapis
"k8s.io/kubernetes/pkg/kubelet/apis"
kubeletapis
"k8s.io/kubernetes/pkg/kubelet/apis"
"k8s.io/kubernetes/pkg/kubelet/util/format"
"k8s.io/kubernetes/pkg/kubelet/util/format"
...
@@ -2654,6 +2655,8 @@ func GetReadyNodesIncludingTaintedOrDie(c clientset.Interface) (nodes *v1.NodeLi
...
@@ -2654,6 +2655,8 @@ func GetReadyNodesIncludingTaintedOrDie(c clientset.Interface) (nodes *v1.NodeLi
return
nodes
return
nodes
}
}
// WaitForAllNodesSchedulable waits up to timeout for all
// (but TestContext.AllowedNotReadyNodes) to become scheduable.
func
WaitForAllNodesSchedulable
(
c
clientset
.
Interface
,
timeout
time
.
Duration
)
error
{
func
WaitForAllNodesSchedulable
(
c
clientset
.
Interface
,
timeout
time
.
Duration
)
error
{
Logf
(
"Waiting up to %v for all (but %d) nodes to be schedulable"
,
timeout
,
TestContext
.
AllowedNotReadyNodes
)
Logf
(
"Waiting up to %v for all (but %d) nodes to be schedulable"
,
timeout
,
TestContext
.
AllowedNotReadyNodes
)
...
@@ -2676,7 +2679,13 @@ func WaitForAllNodesSchedulable(c clientset.Interface, timeout time.Duration) er
...
@@ -2676,7 +2679,13 @@ func WaitForAllNodesSchedulable(c clientset.Interface, timeout time.Duration) er
}
}
for
i
:=
range
nodes
.
Items
{
for
i
:=
range
nodes
.
Items
{
node
:=
&
nodes
.
Items
[
i
]
node
:=
&
nodes
.
Items
[
i
]
if
!
isNodeSchedulable
(
node
)
{
if
_
,
hasMasterRoleLabel
:=
node
.
ObjectMeta
.
Labels
[
service
.
LabelNodeRoleMaster
];
hasMasterRoleLabel
{
// Kops clusters have masters with spec.unscheduable = false and
// node-role.kubernetes.io/master NoSchedule taint.
// Don't wait for them.
continue
}
if
!
isNodeSchedulable
(
node
)
||
!
isNodeUntainted
(
node
)
{
notSchedulable
=
append
(
notSchedulable
,
node
)
notSchedulable
=
append
(
notSchedulable
,
node
)
}
}
}
}
...
@@ -2692,10 +2701,11 @@ func WaitForAllNodesSchedulable(c clientset.Interface, timeout time.Duration) er
...
@@ -2692,10 +2701,11 @@ func WaitForAllNodesSchedulable(c clientset.Interface, timeout time.Duration) er
if
len
(
nodes
.
Items
)
>=
largeClusterThreshold
&&
attempt
%
10
==
0
{
if
len
(
nodes
.
Items
)
>=
largeClusterThreshold
&&
attempt
%
10
==
0
{
Logf
(
"Unschedulable nodes:"
)
Logf
(
"Unschedulable nodes:"
)
for
i
:=
range
notSchedulable
{
for
i
:=
range
notSchedulable
{
Logf
(
"-> %s Ready=%t Network=%t"
,
Logf
(
"-> %s Ready=%t Network=%t
Taints=%v
"
,
notSchedulable
[
i
]
.
Name
,
notSchedulable
[
i
]
.
Name
,
IsNodeConditionSetAsExpectedSilent
(
notSchedulable
[
i
],
v1
.
NodeReady
,
true
),
IsNodeConditionSetAsExpectedSilent
(
notSchedulable
[
i
],
v1
.
NodeReady
,
true
),
IsNodeConditionSetAsExpectedSilent
(
notSchedulable
[
i
],
v1
.
NodeNetworkUnavailable
,
false
))
IsNodeConditionSetAsExpectedSilent
(
notSchedulable
[
i
],
v1
.
NodeNetworkUnavailable
,
false
),
notSchedulable
[
i
]
.
Spec
.
Taints
)
}
}
Logf
(
"================================"
)
Logf
(
"================================"
)
}
}
...
...
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