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
d4aa1864
Commit
d4aa1864
authored
Apr 28, 2015
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7375 from rrati/density-pod-status-7374
Added a method to verify no containers in a pod have failed. The densit...
parents
92a0b385
caf70a28
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
util.go
test/e2e/util.go
+23
-0
No files found.
test/e2e/util.go
View file @
d4aa1864
...
...
@@ -535,6 +535,9 @@ func RunRC(c *client.Client, name string, ns, image string, replicas int) error
for
_
,
p
:=
range
currentPods
.
Items
{
if
p
.
Status
.
Phase
==
api
.
PodRunning
{
current
++
if
err
:=
VerifyContainersAreNotFailed
(
p
);
err
!=
nil
{
return
err
}
}
else
if
p
.
Status
.
Phase
==
api
.
PodPending
{
if
p
.
Spec
.
Host
==
""
{
waiting
++
...
...
@@ -576,3 +579,23 @@ func listPods(c *client.Client, namespace string, label labels.Selector, field f
}
return
pods
,
err
}
func
VerifyContainersAreNotFailed
(
pod
api
.
Pod
)
error
{
var
errStrings
[]
string
statuses
:=
pod
.
Status
.
ContainerStatuses
if
len
(
statuses
)
==
0
{
return
nil
}
else
{
for
_
,
status
:=
range
statuses
{
if
status
.
State
.
Termination
!=
nil
||
status
.
LastTerminationState
.
Termination
!=
nil
||
status
.
RestartCount
!=
0
{
errStrings
=
append
(
errStrings
,
fmt
.
Sprintf
(
"Error: Pod %s: Container %s was found to have terminated %d times"
,
pod
.
Name
,
status
.
Name
,
status
.
RestartCount
))
}
}
}
if
len
(
errStrings
)
>
0
{
return
fmt
.
Errorf
(
strings
.
Join
(
errStrings
,
"
\n
"
))
}
return
nil
}
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