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
2ef2544f
Commit
2ef2544f
authored
Dec 10, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #18237 from yifan-gu/refactor_getphase
Auto commit by PR queue bot
parents
dd0d1fb7
4ac61295
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
17 deletions
+21
-17
kubelet.go
pkg/kubelet/kubelet.go
+21
-17
No files found.
pkg/kubelet/kubelet.go
View file @
2ef2544f
...
@@ -3007,29 +3007,33 @@ func GetPhase(spec *api.PodSpec, info []api.ContainerStatus) api.PodPhase {
...
@@ -3007,29 +3007,33 @@ func GetPhase(spec *api.PodSpec, info []api.ContainerStatus) api.PodPhase {
succeeded
:=
0
succeeded
:=
0
unknown
:=
0
unknown
:=
0
for
_
,
container
:=
range
spec
.
Containers
{
for
_
,
container
:=
range
spec
.
Containers
{
if
containerStatus
,
ok
:=
api
.
GetContainerStatus
(
info
,
container
.
Name
);
ok
{
containerStatus
,
ok
:=
api
.
GetContainerStatus
(
info
,
container
.
Name
)
if
containerStatus
.
State
.
Running
!=
nil
{
if
!
ok
{
running
++
unknown
++
}
else
if
containerStatus
.
State
.
Terminated
!=
nil
{
continue
}
switch
{
case
containerStatus
.
State
.
Running
!=
nil
:
running
++
case
containerStatus
.
State
.
Terminated
!=
nil
:
stopped
++
if
containerStatus
.
State
.
Terminated
.
ExitCode
==
0
{
succeeded
++
}
else
{
failed
++
}
case
containerStatus
.
State
.
Waiting
!=
nil
:
if
containerStatus
.
LastTerminationState
.
Terminated
!=
nil
{
stopped
++
stopped
++
if
containerStatus
.
State
.
Terminated
.
ExitCode
==
0
{
succeeded
++
}
else
{
failed
++
}
}
else
if
containerStatus
.
State
.
Waiting
!=
nil
{
if
containerStatus
.
LastTerminationState
.
Terminated
!=
nil
{
stopped
++
}
else
{
waiting
++
}
}
else
{
}
else
{
unknown
++
waiting
++
}
}
}
else
{
default
:
unknown
++
unknown
++
}
}
}
}
switch
{
switch
{
case
waiting
>
0
:
case
waiting
>
0
:
glog
.
V
(
5
)
.
Infof
(
"pod waiting > 0, pending"
)
glog
.
V
(
5
)
.
Infof
(
"pod waiting > 0, pending"
)
...
...
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