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
8c500a9c
Commit
8c500a9c
authored
Mar 03, 2016
by
Jeff Lowdermilk
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #22279 from soltysh/describer_none
Unifying empty/none/not set values in describer
parents
9cb3f16c
1b56d79f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
describe.go
pkg/kubectl/describe.go
+8
-8
kubectl.go
test/e2e/kubectl.go
+1
-1
No files found.
pkg/kubectl/describe.go
View file @
8c500a9c
...
@@ -577,7 +577,7 @@ func describeVolumes(volumes []api.Volume, out io.Writer) {
...
@@ -577,7 +577,7 @@ func describeVolumes(volumes []api.Volume, out io.Writer) {
case
volume
.
VolumeSource
.
DownwardAPI
!=
nil
:
case
volume
.
VolumeSource
.
DownwardAPI
!=
nil
:
printDownwardAPIVolumeSource
(
volume
.
VolumeSource
.
DownwardAPI
,
out
)
printDownwardAPIVolumeSource
(
volume
.
VolumeSource
.
DownwardAPI
,
out
)
default
:
default
:
fmt
.
Fprintf
(
out
,
" <
Volume Type Not Found
>
\n
"
)
fmt
.
Fprintf
(
out
,
" <
unknown
>
\n
"
)
}
}
}
}
}
}
...
@@ -975,7 +975,7 @@ func describeReplicationController(controller *api.ReplicationController, events
...
@@ -975,7 +975,7 @@ func describeReplicationController(controller *api.ReplicationController, events
if
controller
.
Spec
.
Template
!=
nil
{
if
controller
.
Spec
.
Template
!=
nil
{
fmt
.
Fprintf
(
out
,
"Image(s):
\t
%s
\n
"
,
makeImageList
(
&
controller
.
Spec
.
Template
.
Spec
))
fmt
.
Fprintf
(
out
,
"Image(s):
\t
%s
\n
"
,
makeImageList
(
&
controller
.
Spec
.
Template
.
Spec
))
}
else
{
}
else
{
fmt
.
Fprintf
(
out
,
"Image(s):
\t
%s
\n
"
,
"<
no template
>"
)
fmt
.
Fprintf
(
out
,
"Image(s):
\t
%s
\n
"
,
"<
unset
>"
)
}
}
fmt
.
Fprintf
(
out
,
"Selector:
\t
%s
\n
"
,
labels
.
FormatLabels
(
controller
.
Spec
.
Selector
))
fmt
.
Fprintf
(
out
,
"Selector:
\t
%s
\n
"
,
labels
.
FormatLabels
(
controller
.
Spec
.
Selector
))
fmt
.
Fprintf
(
out
,
"Labels:
\t
%s
\n
"
,
labels
.
FormatLabels
(
controller
.
Labels
))
fmt
.
Fprintf
(
out
,
"Labels:
\t
%s
\n
"
,
labels
.
FormatLabels
(
controller
.
Labels
))
...
@@ -994,7 +994,7 @@ func describeReplicationController(controller *api.ReplicationController, events
...
@@ -994,7 +994,7 @@ func describeReplicationController(controller *api.ReplicationController, events
func
DescribePodTemplate
(
template
*
api
.
PodTemplateSpec
)
(
string
,
error
)
{
func
DescribePodTemplate
(
template
*
api
.
PodTemplateSpec
)
(
string
,
error
)
{
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
if
template
==
nil
{
if
template
==
nil
{
fmt
.
Fprintf
(
out
,
"<
no template
>"
)
fmt
.
Fprintf
(
out
,
"<
unset
>"
)
return
nil
return
nil
}
}
fmt
.
Fprintf
(
out
,
"Labels:
\t
%s
\n
"
,
labels
.
FormatLabels
(
template
.
Labels
))
fmt
.
Fprintf
(
out
,
"Labels:
\t
%s
\n
"
,
labels
.
FormatLabels
(
template
.
Labels
))
...
@@ -1041,7 +1041,7 @@ func describeReplicaSet(rs *extensions.ReplicaSet, events *api.EventList, runnin
...
@@ -1041,7 +1041,7 @@ func describeReplicaSet(rs *extensions.ReplicaSet, events *api.EventList, runnin
if
rs
.
Spec
.
Template
!=
nil
{
if
rs
.
Spec
.
Template
!=
nil
{
fmt
.
Fprintf
(
out
,
"Image(s):
\t
%s
\n
"
,
makeImageList
(
&
rs
.
Spec
.
Template
.
Spec
))
fmt
.
Fprintf
(
out
,
"Image(s):
\t
%s
\n
"
,
makeImageList
(
&
rs
.
Spec
.
Template
.
Spec
))
}
else
{
}
else
{
fmt
.
Fprintf
(
out
,
"Image(s):
\t
%s
\n
"
,
"<
no template
>"
)
fmt
.
Fprintf
(
out
,
"Image(s):
\t
%s
\n
"
,
"<
unset
>"
)
}
}
fmt
.
Fprintf
(
out
,
"Selector:
\t
%s
\n
"
,
unversioned
.
FormatLabelSelector
(
rs
.
Spec
.
Selector
))
fmt
.
Fprintf
(
out
,
"Selector:
\t
%s
\n
"
,
unversioned
.
FormatLabelSelector
(
rs
.
Spec
.
Selector
))
fmt
.
Fprintf
(
out
,
"Labels:
\t
%s
\n
"
,
labels
.
FormatLabels
(
rs
.
Labels
))
fmt
.
Fprintf
(
out
,
"Labels:
\t
%s
\n
"
,
labels
.
FormatLabels
(
rs
.
Labels
))
...
@@ -1084,7 +1084,7 @@ func describeJob(job *extensions.Job, events *api.EventList) (string, error) {
...
@@ -1084,7 +1084,7 @@ func describeJob(job *extensions.Job, events *api.EventList) (string, error) {
if
job
.
Spec
.
Completions
!=
nil
{
if
job
.
Spec
.
Completions
!=
nil
{
fmt
.
Fprintf
(
out
,
"Completions:
\t
%d
\n
"
,
*
job
.
Spec
.
Completions
)
fmt
.
Fprintf
(
out
,
"Completions:
\t
%d
\n
"
,
*
job
.
Spec
.
Completions
)
}
else
{
}
else
{
fmt
.
Fprintf
(
out
,
"Completions:
\t
Not Set
\n
"
)
fmt
.
Fprintf
(
out
,
"Completions:
\t
<unset>
\n
"
)
}
}
if
job
.
Status
.
StartTime
!=
nil
{
if
job
.
Status
.
StartTime
!=
nil
{
fmt
.
Fprintf
(
out
,
"Start Time:
\t
%s
\n
"
,
job
.
Status
.
StartTime
.
Time
.
Format
(
time
.
RFC1123Z
))
fmt
.
Fprintf
(
out
,
"Start Time:
\t
%s
\n
"
,
job
.
Status
.
StartTime
.
Time
.
Format
(
time
.
RFC1123Z
))
...
@@ -1343,7 +1343,7 @@ func describeService(service *api.Service, endpoints *api.Endpoints, events *api
...
@@ -1343,7 +1343,7 @@ func describeService(service *api.Service, endpoints *api.Endpoints, events *api
name
:=
sp
.
Name
name
:=
sp
.
Name
if
name
==
""
{
if
name
==
""
{
name
=
"<un
named
>"
name
=
"<un
set
>"
}
}
fmt
.
Fprintf
(
out
,
"Port:
\t
%s
\t
%d/%s
\n
"
,
name
,
sp
.
Port
,
sp
.
Protocol
)
fmt
.
Fprintf
(
out
,
"Port:
\t
%s
\t
%d/%s
\n
"
,
name
,
sp
.
Port
,
sp
.
Protocol
)
if
sp
.
NodePort
!=
0
{
if
sp
.
NodePort
!=
0
{
...
@@ -1414,7 +1414,7 @@ func describeEndpoints(ep *api.Endpoints, events *api.EventList) (string, error)
...
@@ -1414,7 +1414,7 @@ func describeEndpoints(ep *api.Endpoints, events *api.EventList) (string, error)
for
_
,
port
:=
range
subset
.
Ports
{
for
_
,
port
:=
range
subset
.
Ports
{
name
:=
port
.
Name
name
:=
port
.
Name
if
len
(
name
)
==
0
{
if
len
(
name
)
==
0
{
name
=
"<un
named
>"
name
=
"<un
set
>"
}
}
fmt
.
Fprintf
(
out
,
" %s
\t
%d
\t
%s
\n
"
,
name
,
port
.
Port
,
port
.
Protocol
)
fmt
.
Fprintf
(
out
,
" %s
\t
%d
\t
%s
\n
"
,
name
,
port
.
Port
,
port
.
Protocol
)
}
}
...
@@ -1636,7 +1636,7 @@ func (d *HorizontalPodAutoscalerDescriber) Describe(namespace, name string) (str
...
@@ -1636,7 +1636,7 @@ func (d *HorizontalPodAutoscalerDescriber) Describe(namespace, name string) (str
if
hpa
.
Status
.
CurrentCPUUtilizationPercentage
!=
nil
{
if
hpa
.
Status
.
CurrentCPUUtilizationPercentage
!=
nil
{
fmt
.
Fprintf
(
out
,
"%d%%
\n
"
,
*
hpa
.
Status
.
CurrentCPUUtilizationPercentage
)
fmt
.
Fprintf
(
out
,
"%d%%
\n
"
,
*
hpa
.
Status
.
CurrentCPUUtilizationPercentage
)
}
else
{
}
else
{
fmt
.
Fprintf
(
out
,
"<
not available
>
\n
"
)
fmt
.
Fprintf
(
out
,
"<
unset
>
\n
"
)
}
}
}
}
minReplicas
:=
"<unset>"
minReplicas
:=
"<unset>"
...
...
test/e2e/kubectl.go
View file @
8c500a9c
...
@@ -613,7 +613,7 @@ var _ = Describe("Kubectl client", func() {
...
@@ -613,7 +613,7 @@ var _ = Describe("Kubectl client", func() {
{
"Selector:"
,
"app=redis"
,
"role=master"
},
{
"Selector:"
,
"app=redis"
,
"role=master"
},
{
"Type:"
,
"ClusterIP"
},
{
"Type:"
,
"ClusterIP"
},
{
"IP:"
},
{
"IP:"
},
{
"Port:"
,
"<un
named
>"
,
"6379/TCP"
},
{
"Port:"
,
"<un
set
>"
,
"6379/TCP"
},
{
"Endpoints:"
},
{
"Endpoints:"
},
{
"Session Affinity:"
,
"None"
}}
{
"Session Affinity:"
,
"None"
}}
checkOutput
(
output
,
requiredStrings
)
checkOutput
(
output
,
requiredStrings
)
...
...
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