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
b3744168
Commit
b3744168
authored
Aug 24, 2017
by
Shyam Jeedigunta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AllowedNotReadyNodes allowed to be not ready for absolutely *any* reason
parent
44fc084b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
30 deletions
+3
-30
BUILD
test/e2e/framework/BUILD
+0
-1
util.go
test/e2e/framework/util.go
+3
-29
No files found.
test/e2e/framework/BUILD
View file @
b3744168
...
@@ -43,7 +43,6 @@ go_library(
...
@@ -43,7 +43,6 @@ go_library(
"//pkg/api:go_default_library",
"//pkg/api:go_default_library",
"//pkg/api/testapi:go_default_library",
"//pkg/api/testapi:go_default_library",
"//pkg/api/v1/helper:go_default_library",
"//pkg/api/v1/helper:go_default_library",
"//pkg/api/v1/node:go_default_library",
"//pkg/api/v1/pod:go_default_library",
"//pkg/api/v1/pod:go_default_library",
"//pkg/apis/batch:go_default_library",
"//pkg/apis/batch:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//pkg/apis/extensions:go_default_library",
...
...
test/e2e/framework/util.go
View file @
b3744168
...
@@ -75,7 +75,6 @@ import (
...
@@ -75,7 +75,6 @@ import (
clientset
"k8s.io/client-go/kubernetes"
clientset
"k8s.io/client-go/kubernetes"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/testapi"
nodeutil
"k8s.io/kubernetes/pkg/api/v1/node"
podutil
"k8s.io/kubernetes/pkg/api/v1/pod"
podutil
"k8s.io/kubernetes/pkg/api/v1/pod"
batchinternal
"k8s.io/kubernetes/pkg/apis/batch"
batchinternal
"k8s.io/kubernetes/pkg/apis/batch"
extensionsinternal
"k8s.io/kubernetes/pkg/apis/extensions"
extensionsinternal
"k8s.io/kubernetes/pkg/apis/extensions"
...
@@ -2487,10 +2486,7 @@ func WaitForAllNodesSchedulable(c clientset.Interface, timeout time.Duration) er
...
@@ -2487,10 +2486,7 @@ func WaitForAllNodesSchedulable(c clientset.Interface, timeout time.Duration) er
Logf
(
"================================"
)
Logf
(
"================================"
)
}
}
}
}
if
len
(
notSchedulable
)
>
TestContext
.
AllowedNotReadyNodes
{
return
len
(
notSchedulable
)
<=
TestContext
.
AllowedNotReadyNodes
,
nil
return
false
,
nil
}
return
allowedNotReadyReasons
(
notSchedulable
),
nil
})
})
}
}
...
@@ -3579,23 +3575,6 @@ func WaitForNodeToBe(c clientset.Interface, name string, conditionType v1.NodeCo
...
@@ -3579,23 +3575,6 @@ func WaitForNodeToBe(c clientset.Interface, name string, conditionType v1.NodeCo
return
false
return
false
}
}
// Checks whether not-ready nodes can be ignored while checking if all nodes are
// ready (we allow e.g. for incorrect provisioning of some small percentage of nodes
// while validating cluster, and those nodes may never become healthy).
// Currently we allow only for:
// - not present CNI plugins on node
// TODO: we should extend it for other reasons.
func
allowedNotReadyReasons
(
nodes
[]
*
v1
.
Node
)
bool
{
for
_
,
node
:=
range
nodes
{
index
,
condition
:=
nodeutil
.
GetNodeCondition
(
&
node
.
Status
,
v1
.
NodeReady
)
if
index
==
-
1
||
!
strings
.
Contains
(
condition
.
Message
,
"could not locate kubenet required CNI plugins"
)
{
return
false
}
}
return
true
}
// Checks whether all registered nodes are ready.
// Checks whether all registered nodes are ready.
// TODO: we should change the AllNodesReady call in AfterEach to WaitForAllNodesHealthy,
// TODO: we should change the AllNodesReady call in AfterEach to WaitForAllNodesHealthy,
// and figure out how to do it in a configurable way, as we can't expect all setups to run
// and figure out how to do it in a configurable way, as we can't expect all setups to run
...
@@ -3625,19 +3604,14 @@ func AllNodesReady(c clientset.Interface, timeout time.Duration) error {
...
@@ -3625,19 +3604,14 @@ func AllNodesReady(c clientset.Interface, timeout time.Duration) error {
// of nodes (which we allow in cluster validation). Some nodes that are not
// of nodes (which we allow in cluster validation). Some nodes that are not
// provisioned correctly at startup will never become ready (e.g. when something
// provisioned correctly at startup will never become ready (e.g. when something
// won't install correctly), so we can't expect them to be ready at any point.
// won't install correctly), so we can't expect them to be ready at any point.
//
return
len
(
notReady
)
<=
TestContext
.
AllowedNotReadyNodes
,
nil
// However, we only allow non-ready nodes with some specific reasons.
if
len
(
notReady
)
>
TestContext
.
AllowedNotReadyNodes
{
return
false
,
nil
}
return
allowedNotReadyReasons
(
notReady
),
nil
})
})
if
err
!=
nil
&&
err
!=
wait
.
ErrWaitTimeout
{
if
err
!=
nil
&&
err
!=
wait
.
ErrWaitTimeout
{
return
err
return
err
}
}
if
len
(
notReady
)
>
TestContext
.
AllowedNotReadyNodes
||
!
allowedNotReadyReasons
(
notReady
)
{
if
len
(
notReady
)
>
TestContext
.
AllowedNotReadyNodes
{
msg
:=
""
msg
:=
""
for
_
,
node
:=
range
notReady
{
for
_
,
node
:=
range
notReady
{
msg
=
fmt
.
Sprintf
(
"%s, %s"
,
msg
,
node
.
Name
)
msg
=
fmt
.
Sprintf
(
"%s, %s"
,
msg
,
node
.
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