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
abc7c4cf
Commit
abc7c4cf
authored
May 22, 2017
by
xiangpengzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add AzureFile,Flex,Flocker volume source to describe printer.
parent
0dff56b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
describe.go
pkg/printers/internalversion/describe.go
+39
-0
No files found.
pkg/printers/internalversion/describe.go
View file @
abc7c4cf
...
@@ -747,6 +747,12 @@ func describeVolumes(volumes []api.Volume, w PrefixWriter, space string) {
...
@@ -747,6 +747,12 @@ func describeVolumes(volumes []api.Volume, w PrefixWriter, space string) {
printStorageOSVolumeSource
(
volume
.
VolumeSource
.
StorageOS
,
w
)
printStorageOSVolumeSource
(
volume
.
VolumeSource
.
StorageOS
,
w
)
case
volume
.
VolumeSource
.
FC
!=
nil
:
case
volume
.
VolumeSource
.
FC
!=
nil
:
printFCVolumeSource
(
volume
.
VolumeSource
.
FC
,
w
)
printFCVolumeSource
(
volume
.
VolumeSource
.
FC
,
w
)
case
volume
.
VolumeSource
.
AzureFile
!=
nil
:
printAzureFileVolumeSource
(
volume
.
VolumeSource
.
AzureFile
,
w
)
case
volume
.
VolumeSource
.
FlexVolume
!=
nil
:
printFlexVolumeSource
(
volume
.
VolumeSource
.
FlexVolume
,
w
)
case
volume
.
VolumeSource
.
Flocker
!=
nil
:
printFlockerVolumeSource
(
volume
.
VolumeSource
.
Flocker
,
w
)
default
:
default
:
w
.
Write
(
LEVEL_1
,
"<unknown>
\n
"
)
w
.
Write
(
LEVEL_1
,
"<unknown>
\n
"
)
}
}
...
@@ -976,6 +982,31 @@ func printFCVolumeSource(fc *api.FCVolumeSource, w PrefixWriter) {
...
@@ -976,6 +982,31 @@ func printFCVolumeSource(fc *api.FCVolumeSource, w PrefixWriter) {
strings
.
Join
(
fc
.
TargetWWNs
,
", "
),
lun
,
fc
.
FSType
,
fc
.
ReadOnly
)
strings
.
Join
(
fc
.
TargetWWNs
,
", "
),
lun
,
fc
.
FSType
,
fc
.
ReadOnly
)
}
}
func
printAzureFileVolumeSource
(
azureFile
*
api
.
AzureFileVolumeSource
,
w
PrefixWriter
)
{
w
.
Write
(
LEVEL_2
,
"Type:
\t
AzureFile (an Azure File Service mount on the host and bind mount to the pod)
\n
"
+
" SecretName:
\t
%v
\n
"
+
" ShareName:
\t
%v
\n
"
+
" ReadOnly:
\t
%v
\n
"
,
azureFile
.
SecretName
,
azureFile
.
ShareName
,
azureFile
.
ReadOnly
)
}
func
printFlexVolumeSource
(
flex
*
api
.
FlexVolumeSource
,
w
PrefixWriter
)
{
w
.
Write
(
LEVEL_2
,
"Type:
\t
FlexVolume (a generic volume resource that is provisioned/attached using an exec based plugin)
\n
"
+
" Driver:
\t
%v
\n
"
+
" FSType:
\t
%v
\n
"
+
" SecretRef:
\t
%v
\n
"
+
" ReadOnly:
\t
%v
\n
"
,
" Options:
\t
%v
\n
"
,
flex
.
Driver
,
flex
.
FSType
,
flex
.
SecretRef
,
flex
.
ReadOnly
,
flex
.
Options
)
}
func
printFlockerVolumeSource
(
flocker
*
api
.
FlockerVolumeSource
,
w
PrefixWriter
)
{
w
.
Write
(
LEVEL_2
,
"Type:
\t
Flocker (a Flocker volume mounted by the Flocker agent)
\n
"
+
" DatasetName:
\t
%v
\n
"
+
" DatasetUUID:
\t
%v
\n
"
,
flocker
.
DatasetName
,
flocker
.
DatasetUUID
)
}
type
PersistentVolumeDescriber
struct
{
type
PersistentVolumeDescriber
struct
{
clientset
.
Interface
clientset
.
Interface
}
}
...
@@ -1053,6 +1084,14 @@ func describePersistentVolume(pv *api.PersistentVolume, events *api.EventList) (
...
@@ -1053,6 +1084,14 @@ func describePersistentVolume(pv *api.PersistentVolume, events *api.EventList) (
printStorageOSPersistentVolumeSource
(
pv
.
Spec
.
StorageOS
,
w
)
printStorageOSPersistentVolumeSource
(
pv
.
Spec
.
StorageOS
,
w
)
case
pv
.
Spec
.
FC
!=
nil
:
case
pv
.
Spec
.
FC
!=
nil
:
printFCVolumeSource
(
pv
.
Spec
.
FC
,
w
)
printFCVolumeSource
(
pv
.
Spec
.
FC
,
w
)
case
pv
.
Spec
.
AzureFile
!=
nil
:
printAzureFileVolumeSource
(
pv
.
Spec
.
AzureFile
,
w
)
case
pv
.
Spec
.
FlexVolume
!=
nil
:
printFlexVolumeSource
(
pv
.
Spec
.
FlexVolume
,
w
)
case
pv
.
Spec
.
Flocker
!=
nil
:
printFlockerVolumeSource
(
pv
.
Spec
.
Flocker
,
w
)
default
:
w
.
Write
(
LEVEL_1
,
"<unknown>
\n
"
)
}
}
if
events
!=
nil
{
if
events
!=
nil
{
...
...
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