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
de64f526
Commit
de64f526
authored
May 14, 2017
by
zhangxiaoyu-zidif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display <none> for kubectl describe pod when node is empty.
parent
4807e6ca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
describe.go
pkg/printers/internalversion/describe.go
+5
-1
No files found.
pkg/printers/internalversion/describe.go
View file @
de64f526
...
@@ -604,7 +604,11 @@ func describePod(pod *api.Pod, events *api.EventList) (string, error) {
...
@@ -604,7 +604,11 @@ func describePod(pod *api.Pod, events *api.EventList) (string, error) {
w
:=
NewPrefixWriter
(
out
)
w
:=
NewPrefixWriter
(
out
)
w
.
Write
(
LEVEL_0
,
"Name:
\t
%s
\n
"
,
pod
.
Name
)
w
.
Write
(
LEVEL_0
,
"Name:
\t
%s
\n
"
,
pod
.
Name
)
w
.
Write
(
LEVEL_0
,
"Namespace:
\t
%s
\n
"
,
pod
.
Namespace
)
w
.
Write
(
LEVEL_0
,
"Namespace:
\t
%s
\n
"
,
pod
.
Namespace
)
w
.
Write
(
LEVEL_0
,
"Node:
\t
%s
\n
"
,
pod
.
Spec
.
NodeName
+
"/"
+
pod
.
Status
.
HostIP
)
if
pod
.
Spec
.
NodeName
==
""
{
w
.
Write
(
LEVEL_0
,
"Node:
\t
<none>
\n
"
)
}
else
{
w
.
Write
(
LEVEL_0
,
"Node:
\t
%s
\n
"
,
pod
.
Spec
.
NodeName
+
"/"
+
pod
.
Status
.
HostIP
)
}
if
pod
.
Status
.
StartTime
!=
nil
{
if
pod
.
Status
.
StartTime
!=
nil
{
w
.
Write
(
LEVEL_0
,
"Start Time:
\t
%s
\n
"
,
pod
.
Status
.
StartTime
.
Time
.
Format
(
time
.
RFC1123Z
))
w
.
Write
(
LEVEL_0
,
"Start Time:
\t
%s
\n
"
,
pod
.
Status
.
StartTime
.
Time
.
Format
(
time
.
RFC1123Z
))
}
}
...
...
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