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
62aca7e7
Commit
62aca7e7
authored
Jul 01, 2015
by
Zach Loafman
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9791 from hurf/ns_describe
Display namespace while describing resources.
parents
9e23ad71
b13d29fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
describe.go
pkg/kubectl/describe.go
+8
-0
No files found.
pkg/kubectl/describe.go
View file @
62aca7e7
...
@@ -270,6 +270,7 @@ func (d *LimitRangeDescriber) Describe(namespace, name string) (string, error) {
...
@@ -270,6 +270,7 @@ func (d *LimitRangeDescriber) Describe(namespace, name string) (string, error) {
func
describeLimitRange
(
limitRange
*
api
.
LimitRange
)
(
string
,
error
)
{
func
describeLimitRange
(
limitRange
*
api
.
LimitRange
)
(
string
,
error
)
{
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
fmt
.
Fprintf
(
out
,
"Name:
\t
%s
\n
"
,
limitRange
.
Name
)
fmt
.
Fprintf
(
out
,
"Name:
\t
%s
\n
"
,
limitRange
.
Name
)
fmt
.
Fprintf
(
out
,
"Namespace:
\t
%s
\n
"
,
limitRange
.
Namespace
)
fmt
.
Fprintf
(
out
,
"Type
\t
Resource
\t
Min
\t
Max
\t
Default
\n
"
)
fmt
.
Fprintf
(
out
,
"Type
\t
Resource
\t
Min
\t
Max
\t
Default
\n
"
)
fmt
.
Fprintf
(
out
,
"----
\t
--------
\t
---
\t
---
\t
---
\n
"
)
fmt
.
Fprintf
(
out
,
"----
\t
--------
\t
---
\t
---
\t
---
\n
"
)
for
i
:=
range
limitRange
.
Spec
.
Limits
{
for
i
:=
range
limitRange
.
Spec
.
Limits
{
...
@@ -337,6 +338,7 @@ func (d *ResourceQuotaDescriber) Describe(namespace, name string) (string, error
...
@@ -337,6 +338,7 @@ func (d *ResourceQuotaDescriber) Describe(namespace, name string) (string, error
func
describeQuota
(
resourceQuota
*
api
.
ResourceQuota
)
(
string
,
error
)
{
func
describeQuota
(
resourceQuota
*
api
.
ResourceQuota
)
(
string
,
error
)
{
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
fmt
.
Fprintf
(
out
,
"Name:
\t
%s
\n
"
,
resourceQuota
.
Name
)
fmt
.
Fprintf
(
out
,
"Name:
\t
%s
\n
"
,
resourceQuota
.
Name
)
fmt
.
Fprintf
(
out
,
"Namespace:
\t
%s
\n
"
,
resourceQuota
.
Namespace
)
fmt
.
Fprintf
(
out
,
"Resource
\t
Used
\t
Hard
\n
"
)
fmt
.
Fprintf
(
out
,
"Resource
\t
Used
\t
Hard
\n
"
)
fmt
.
Fprintf
(
out
,
"--------
\t
----
\t
----
\n
"
)
fmt
.
Fprintf
(
out
,
"--------
\t
----
\t
----
\n
"
)
...
@@ -402,6 +404,7 @@ func (d *PodDescriber) Describe(namespace, name string) (string, error) {
...
@@ -402,6 +404,7 @@ func (d *PodDescriber) Describe(namespace, name string) (string, error) {
func
describePod
(
pod
*
api
.
Pod
,
rcs
[]
api
.
ReplicationController
,
events
*
api
.
EventList
)
(
string
,
error
)
{
func
describePod
(
pod
*
api
.
Pod
,
rcs
[]
api
.
ReplicationController
,
events
*
api
.
EventList
)
(
string
,
error
)
{
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
fmt
.
Fprintf
(
out
,
"Name:
\t
%s
\n
"
,
pod
.
Name
)
fmt
.
Fprintf
(
out
,
"Name:
\t
%s
\n
"
,
pod
.
Name
)
fmt
.
Fprintf
(
out
,
"Namespace:
\t
%s
\n
"
,
pod
.
Namespace
)
fmt
.
Fprintf
(
out
,
"Image(s):
\t
%s
\n
"
,
makeImageList
(
&
pod
.
Spec
))
fmt
.
Fprintf
(
out
,
"Image(s):
\t
%s
\n
"
,
makeImageList
(
&
pod
.
Spec
))
fmt
.
Fprintf
(
out
,
"Node:
\t
%s
\n
"
,
pod
.
Spec
.
NodeName
+
"/"
+
pod
.
Status
.
HostIP
)
fmt
.
Fprintf
(
out
,
"Node:
\t
%s
\n
"
,
pod
.
Spec
.
NodeName
+
"/"
+
pod
.
Status
.
HostIP
)
fmt
.
Fprintf
(
out
,
"Labels:
\t
%s
\n
"
,
formatLabels
(
pod
.
Labels
))
fmt
.
Fprintf
(
out
,
"Labels:
\t
%s
\n
"
,
formatLabels
(
pod
.
Labels
))
...
@@ -468,6 +471,7 @@ func (d *PersistentVolumeClaimDescriber) Describe(namespace, name string) (strin
...
@@ -468,6 +471,7 @@ func (d *PersistentVolumeClaimDescriber) Describe(namespace, name string) (strin
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
fmt
.
Fprintf
(
out
,
"Name:
\t
%s
\n
"
,
pvc
.
Name
)
fmt
.
Fprintf
(
out
,
"Name:
\t
%s
\n
"
,
pvc
.
Name
)
fmt
.
Fprintf
(
out
,
"Namespace:
\t
%s
\n
"
,
pvc
.
Namespace
)
fmt
.
Fprintf
(
out
,
"Status:
\t
%d
\n
"
,
pvc
.
Status
.
Phase
)
fmt
.
Fprintf
(
out
,
"Status:
\t
%d
\n
"
,
pvc
.
Status
.
Phase
)
fmt
.
Fprintf
(
out
,
"Volume:
\t
%d
\n
"
,
pvc
.
Spec
.
VolumeName
)
fmt
.
Fprintf
(
out
,
"Volume:
\t
%d
\n
"
,
pvc
.
Spec
.
VolumeName
)
...
@@ -563,6 +567,7 @@ func (d *ReplicationControllerDescriber) Describe(namespace, name string) (strin
...
@@ -563,6 +567,7 @@ func (d *ReplicationControllerDescriber) Describe(namespace, name string) (strin
func
describeReplicationController
(
controller
*
api
.
ReplicationController
,
events
*
api
.
EventList
,
running
,
waiting
,
succeeded
,
failed
int
)
(
string
,
error
)
{
func
describeReplicationController
(
controller
*
api
.
ReplicationController
,
events
*
api
.
EventList
,
running
,
waiting
,
succeeded
,
failed
int
)
(
string
,
error
)
{
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
fmt
.
Fprintf
(
out
,
"Name:
\t
%s
\n
"
,
controller
.
Name
)
fmt
.
Fprintf
(
out
,
"Name:
\t
%s
\n
"
,
controller
.
Name
)
fmt
.
Fprintf
(
out
,
"Namespace:
\t
%s
\n
"
,
controller
.
Namespace
)
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
{
...
@@ -598,6 +603,7 @@ func (d *SecretDescriber) Describe(namespace, name string) (string, error) {
...
@@ -598,6 +603,7 @@ func (d *SecretDescriber) Describe(namespace, name string) (string, error) {
func
describeSecret
(
secret
*
api
.
Secret
)
(
string
,
error
)
{
func
describeSecret
(
secret
*
api
.
Secret
)
(
string
,
error
)
{
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
fmt
.
Fprintf
(
out
,
"Name:
\t
%s
\n
"
,
secret
.
Name
)
fmt
.
Fprintf
(
out
,
"Name:
\t
%s
\n
"
,
secret
.
Name
)
fmt
.
Fprintf
(
out
,
"Namespace:
\t
%s
\n
"
,
secret
.
Namespace
)
fmt
.
Fprintf
(
out
,
"Labels:
\t
%s
\n
"
,
formatLabels
(
secret
.
Labels
))
fmt
.
Fprintf
(
out
,
"Labels:
\t
%s
\n
"
,
formatLabels
(
secret
.
Labels
))
fmt
.
Fprintf
(
out
,
"Annotations:
\t
%s
\n
"
,
formatLabels
(
secret
.
Annotations
))
fmt
.
Fprintf
(
out
,
"Annotations:
\t
%s
\n
"
,
formatLabels
(
secret
.
Annotations
))
...
@@ -658,6 +664,7 @@ func describeService(service *api.Service, endpoints *api.Endpoints, events *api
...
@@ -658,6 +664,7 @@ func describeService(service *api.Service, endpoints *api.Endpoints, events *api
}
}
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
fmt
.
Fprintf
(
out
,
"Name:
\t
%s
\n
"
,
service
.
Name
)
fmt
.
Fprintf
(
out
,
"Name:
\t
%s
\n
"
,
service
.
Name
)
fmt
.
Fprintf
(
out
,
"Namespace:
\t
%s
\n
"
,
service
.
Namespace
)
fmt
.
Fprintf
(
out
,
"Labels:
\t
%s
\n
"
,
formatLabels
(
service
.
Labels
))
fmt
.
Fprintf
(
out
,
"Labels:
\t
%s
\n
"
,
formatLabels
(
service
.
Labels
))
fmt
.
Fprintf
(
out
,
"Selector:
\t
%s
\n
"
,
formatLabels
(
service
.
Spec
.
Selector
))
fmt
.
Fprintf
(
out
,
"Selector:
\t
%s
\n
"
,
formatLabels
(
service
.
Spec
.
Selector
))
fmt
.
Fprintf
(
out
,
"Type:
\t
%s
\n
"
,
service
.
Spec
.
Type
)
fmt
.
Fprintf
(
out
,
"Type:
\t
%s
\n
"
,
service
.
Spec
.
Type
)
...
@@ -720,6 +727,7 @@ func (d *ServiceAccountDescriber) Describe(namespace, name string) (string, erro
...
@@ -720,6 +727,7 @@ func (d *ServiceAccountDescriber) Describe(namespace, name string) (string, erro
func
describeServiceAccount
(
serviceAccount
*
api
.
ServiceAccount
,
tokens
[]
api
.
Secret
)
(
string
,
error
)
{
func
describeServiceAccount
(
serviceAccount
*
api
.
ServiceAccount
,
tokens
[]
api
.
Secret
)
(
string
,
error
)
{
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
fmt
.
Fprintf
(
out
,
"Name:
\t
%s
\n
"
,
serviceAccount
.
Name
)
fmt
.
Fprintf
(
out
,
"Name:
\t
%s
\n
"
,
serviceAccount
.
Name
)
fmt
.
Fprintf
(
out
,
"Namespace:
\t
%s
\n
"
,
serviceAccount
.
Namespace
)
fmt
.
Fprintf
(
out
,
"Labels:
\t
%s
\n
"
,
formatLabels
(
serviceAccount
.
Labels
))
fmt
.
Fprintf
(
out
,
"Labels:
\t
%s
\n
"
,
formatLabels
(
serviceAccount
.
Labels
))
if
len
(
serviceAccount
.
Secrets
)
==
0
{
if
len
(
serviceAccount
.
Secrets
)
==
0
{
...
...
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