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
dbb24264
Commit
dbb24264
authored
Jul 27, 2017
by
jeff vance
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert most of the changes, add comments
parent
1f186fc6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
util.go
test/e2e/framework/util.go
+9
-5
No files found.
test/e2e/framework/util.go
View file @
dbb24264
...
...
@@ -1355,13 +1355,17 @@ func podNotPending(c clientset.Interface, podName, namespace string) wait.Condit
}
}
// waitForPodTerminatedInNamespace returns an error if it took too long for the pod
// to terminate or if the pod terminated with an unexpected reason.
// waitForPodTerminatedInNamespace returns an error if it takes too long for the pod to terminate,
// if the pod Get api returns an error (IsNotFound or other), or if the pod failed (and thus did not
// terminate) with an unexpected reason. Typically called to test that the passed-in pod is fully
// terminated (reason==""), but may be called to detect if a pod did *not* terminate according to
// the supplied reason.
func
waitForPodTerminatedInNamespace
(
c
clientset
.
Interface
,
podName
,
reason
,
namespace
string
)
error
{
return
WaitForPodCondition
(
c
,
namespace
,
podName
,
"terminated due to deadline exceeded"
,
PodStartTimeout
,
func
(
pod
*
v1
.
Pod
)
(
bool
,
error
)
{
if
pod
.
Status
.
Phase
==
v1
.
PodSucceeded
||
pod
.
Status
.
Phase
==
v1
.
PodFailed
{
if
reason
==
""
||
strings
.
ToLower
(
strings
.
TrimSpace
(
pod
.
Status
.
Reason
))
==
strings
.
ToLower
(
strings
.
TrimSpace
(
reason
))
{
// Only consider Failed pods. Successful pods will be deleted and detected in
// waitForPodCondition's Get call returning `IsNotFound`
if
pod
.
Status
.
Phase
==
v1
.
PodFailed
{
if
pod
.
Status
.
Reason
==
reason
{
// short-circuit waitForPodCondition's loop
return
true
,
nil
}
else
{
return
true
,
fmt
.
Errorf
(
"Expected pod %q in namespace %q to be terminated with reason %q, got reason: %q"
,
podName
,
namespace
,
reason
,
pod
.
Status
.
Reason
)
...
...
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