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
465d578d
Unverified
Commit
465d578d
authored
Nov 07, 2018
by
k8s-ci-robot
Committed by
GitHub
Nov 07, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #70695 from mborsz/DeleteResourceAndWaitForGC
Few improvements to DeleteResourceAndWaitForGC
parents
7fe59165
fa31f65d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
util.go
test/e2e/framework/util.go
+17
-5
No files found.
test/e2e/framework/util.go
View file @
465d578d
...
...
@@ -3161,7 +3161,10 @@ func DeleteResourceAndWaitForGC(c clientset.Interface, kind schema.GroupKind, ns
terminatePodTime
:=
time
.
Since
(
startTime
)
-
deleteTime
Logf
(
"Terminating %v %s pods took: %v"
,
kind
,
name
,
terminatePodTime
)
err
=
waitForPodsGone
(
ps
,
interval
,
10
*
time
.
Minute
)
// In gce, at any point, small percentage of nodes can disappear for
// ~10 minutes due to hostError. 20 minutes should be long enough to
// restart VM in that case and delete the pod.
err
=
waitForPodsGone
(
ps
,
interval
,
20
*
time
.
Minute
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"error while waiting for pods gone %s: %v"
,
name
,
err
)
}
...
...
@@ -3191,21 +3194,30 @@ func waitForPodsInactive(ps *testutils.PodStore, interval, timeout time.Duration
if
err
==
wait
.
ErrWaitTimeout
{
for
_
,
pod
:=
range
activePods
{
Logf
(
"
Pod %q running on %q is still active"
,
pod
.
ObjectMeta
.
Name
,
pod
.
Spec
.
NodeName
)
Logf
(
"
ERROR: Pod %q running on %q is still active"
,
pod
.
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
fmt
.
Errorf
(
"there are %d active pods. E.g. %q on node %q"
,
len
(
activePods
),
activePods
[
0
]
.
Name
,
activePods
[
0
]
.
Spec
.
NodeName
)
}
return
err
}
// waitForPodsGone waits until there are no pods left in the PodStore.
func
waitForPodsGone
(
ps
*
testutils
.
PodStore
,
interval
,
timeout
time
.
Duration
)
error
{
return
wait
.
PollImmediate
(
interval
,
timeout
,
func
()
(
bool
,
error
)
{
if
pods
:=
ps
.
List
();
len
(
pods
)
==
0
{
var
pods
[]
*
v1
.
Pod
err
:=
wait
.
PollImmediate
(
interval
,
timeout
,
func
()
(
bool
,
error
)
{
if
pods
=
ps
.
List
();
len
(
pods
)
==
0
{
return
true
,
nil
}
return
false
,
nil
})
if
err
==
wait
.
ErrWaitTimeout
{
for
_
,
pod
:=
range
pods
{
Logf
(
"ERROR: Pod %q still exists. Node: %q"
,
pod
.
Name
,
pod
.
Spec
.
NodeName
)
}
return
fmt
.
Errorf
(
"there are %d pods left. E.g. %q on node %q"
,
len
(
pods
),
pods
[
0
]
.
Name
,
pods
[
0
]
.
Spec
.
NodeName
)
}
return
err
}
func
WaitForPodsReady
(
c
clientset
.
Interface
,
ns
,
name
string
,
minReadySeconds
int
)
error
{
...
...
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