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
95014b26
Unverified
Commit
95014b26
authored
Nov 06, 2018
by
k8s-ci-robot
Committed by
GitHub
Nov 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #70689 from mborsz/waitForPodsInactive
Modify waitForPodsInactive to return meaningful error message.
parents
50de3a0d
760f7dd2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
util.go
test/e2e/framework/util.go
+16
-2
No files found.
test/e2e/framework/util.go
View file @
95014b26
...
...
@@ -3173,15 +3173,29 @@ func DeleteResourceAndWaitForGC(c clientset.Interface, kind schema.GroupKind, ns
// and DeleteRCAndWaitForGC, because the RC controller decreases status.replicas
// when the pod is inactvie.
func
waitForPodsInactive
(
ps
*
testutils
.
PodStore
,
interval
,
timeout
time
.
Duration
)
error
{
return
wait
.
PollImmediate
(
interval
,
timeout
,
func
()
(
bool
,
error
)
{
var
activePods
[]
*
v1
.
Pod
err
:=
wait
.
PollImmediate
(
interval
,
timeout
,
func
()
(
bool
,
error
)
{
pods
:=
ps
.
List
()
activePods
=
nil
for
_
,
pod
:=
range
pods
{
if
controller
.
IsPodActive
(
pod
)
{
return
false
,
nil
activePods
=
append
(
activePods
,
pod
)
}
}
if
len
(
activePods
)
!=
0
{
return
false
,
nil
}
return
true
,
nil
})
if
err
==
wait
.
ErrWaitTimeout
{
for
_
,
pod
:=
range
activePods
{
Logf
(
"Pod %q running on %q is still active"
,
pod
.
ObjectMeta
.
Name
,
pod
.
Spec
.
NodeName
)
}
return
fmt
.
Errorf
(
"there are %d active pods. E.g. %q on node %q"
,
len
(
activePods
),
activePods
[
0
]
.
ObjectMeta
.
Name
,
activePods
[
0
]
.
Spec
.
NodeName
)
}
return
err
}
// waitForPodsGone waits until there are no pods left in the PodStore.
...
...
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