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
240e2140
Commit
240e2140
authored
Oct 24, 2018
by
WanLinghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for projected volume in describe function
parent
dbdcb7e0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
describe.go
pkg/printers/internalversion/describe.go
+22
-0
No files found.
pkg/printers/internalversion/describe.go
View file @
240e2140
...
@@ -774,6 +774,8 @@ func describeVolumes(volumes []api.Volume, w PrefixWriter, space string) {
...
@@ -774,6 +774,8 @@ func describeVolumes(volumes []api.Volume, w PrefixWriter, space string) {
printFlexVolumeSource
(
volume
.
VolumeSource
.
FlexVolume
,
w
)
printFlexVolumeSource
(
volume
.
VolumeSource
.
FlexVolume
,
w
)
case
volume
.
VolumeSource
.
Flocker
!=
nil
:
case
volume
.
VolumeSource
.
Flocker
!=
nil
:
printFlockerVolumeSource
(
volume
.
VolumeSource
.
Flocker
,
w
)
printFlockerVolumeSource
(
volume
.
VolumeSource
.
Flocker
,
w
)
case
volume
.
VolumeSource
.
Projected
!=
nil
:
printProjectedVolumeSource
(
volume
.
VolumeSource
.
Projected
,
w
)
default
:
default
:
w
.
Write
(
LEVEL_1
,
"<unknown>
\n
"
)
w
.
Write
(
LEVEL_1
,
"<unknown>
\n
"
)
}
}
...
@@ -837,6 +839,26 @@ func printConfigMapVolumeSource(configMap *api.ConfigMapVolumeSource, w PrefixWr
...
@@ -837,6 +839,26 @@ func printConfigMapVolumeSource(configMap *api.ConfigMapVolumeSource, w PrefixWr
configMap
.
Name
,
optional
)
configMap
.
Name
,
optional
)
}
}
func
printProjectedVolumeSource
(
projected
*
api
.
ProjectedVolumeSource
,
w
PrefixWriter
)
{
w
.
Write
(
LEVEL_2
,
"Type:
\t
Projected (a volume that contains injected data from multiple sources)
\n
"
)
for
_
,
source
:=
range
projected
.
Sources
{
if
source
.
Secret
!=
nil
{
w
.
Write
(
LEVEL_2
,
"SecretName:
\t
%v
\n
"
+
" SecretOptionalName:
\t
%v
\n
"
,
source
.
Secret
.
Name
,
source
.
Secret
.
Optional
)
}
else
if
source
.
DownwardAPI
!=
nil
{
w
.
Write
(
LEVEL_2
,
"DownwardAPI:
\t
true
\n
"
)
}
else
if
source
.
ConfigMap
!=
nil
{
w
.
Write
(
LEVEL_2
,
"ConfigMapName:
\t
%v
\n
"
+
" ConfigMapOptional:
\t
%v
\n
"
,
source
.
ConfigMap
.
Name
,
source
.
ConfigMap
.
Optional
)
}
else
if
source
.
ServiceAccountToken
!=
nil
{
w
.
Write
(
LEVEL_2
,
"TokenExpirationSeconds:
\t
%v
\n
"
,
source
.
ServiceAccountToken
.
ExpirationSeconds
)
}
}
}
func
printNFSVolumeSource
(
nfs
*
api
.
NFSVolumeSource
,
w
PrefixWriter
)
{
func
printNFSVolumeSource
(
nfs
*
api
.
NFSVolumeSource
,
w
PrefixWriter
)
{
w
.
Write
(
LEVEL_2
,
"Type:
\t
NFS (an NFS mount that lasts the lifetime of a pod)
\n
"
+
w
.
Write
(
LEVEL_2
,
"Type:
\t
NFS (an NFS mount that lasts the lifetime of a pod)
\n
"
+
" Server:
\t
%v
\n
"
+
" Server:
\t
%v
\n
"
+
...
...
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