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
3fc8416e
Commit
3fc8416e
authored
Aug 30, 2016
by
Huamin Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print Cinder volume source in kubectl describe
Signed-off-by:
Huamin Chen
<
hchen@redhat.com
>
parent
456c78a8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
describe.go
pkg/kubectl/describe.go
+11
-0
describe_test.go
pkg/kubectl/describe_test.go
+7
-0
No files found.
pkg/kubectl/describe.go
View file @
3fc8416e
...
@@ -612,6 +612,8 @@ func describeVolumes(volumes []api.Volume, out io.Writer, space string) {
...
@@ -612,6 +612,8 @@ func describeVolumes(volumes []api.Volume, out io.Writer, space string) {
printAzureDiskVolumeSource
(
volume
.
VolumeSource
.
AzureDisk
,
out
)
printAzureDiskVolumeSource
(
volume
.
VolumeSource
.
AzureDisk
,
out
)
case
volume
.
VolumeSource
.
VsphereVolume
!=
nil
:
case
volume
.
VolumeSource
.
VsphereVolume
!=
nil
:
printVsphereVolumeSource
(
volume
.
VolumeSource
.
VsphereVolume
,
out
)
printVsphereVolumeSource
(
volume
.
VolumeSource
.
VsphereVolume
,
out
)
case
volume
.
VolumeSource
.
Cinder
!=
nil
:
printCinderVolumeSource
(
volume
.
VolumeSource
.
Cinder
,
out
)
default
:
default
:
fmt
.
Fprintf
(
out
,
" <unknown>
\n
"
)
fmt
.
Fprintf
(
out
,
" <unknown>
\n
"
)
}
}
...
@@ -746,6 +748,13 @@ func printVsphereVolumeSource(vsphere *api.VsphereVirtualDiskVolumeSource, out i
...
@@ -746,6 +748,13 @@ func printVsphereVolumeSource(vsphere *api.VsphereVirtualDiskVolumeSource, out i
" FSType:
\t
%v
\n
"
,
" FSType:
\t
%v
\n
"
,
vsphere
.
VolumePath
,
vsphere
.
FSType
)
vsphere
.
VolumePath
,
vsphere
.
FSType
)
}
}
func
printCinderVolumeSource
(
cinder
*
api
.
CinderVolumeSource
,
out
io
.
Writer
)
{
fmt
.
Fprintf
(
out
,
" Type:
\t
Cinder (a Persistent Disk resource in OpenStack)
\n
"
+
" VolumeID:
\t
%v
\n
"
+
" FSType:
\t
%v
\n
"
+
" ReadOnly:
\t
%v
\n
"
,
cinder
.
VolumeID
,
cinder
.
FSType
,
cinder
.
ReadOnly
)
}
type
PersistentVolumeDescriber
struct
{
type
PersistentVolumeDescriber
struct
{
client
.
Interface
client
.
Interface
...
@@ -800,6 +809,8 @@ func (d *PersistentVolumeDescriber) Describe(namespace, name string, describerSe
...
@@ -800,6 +809,8 @@ func (d *PersistentVolumeDescriber) Describe(namespace, name string, describerSe
printQuobyteVolumeSource
(
pv
.
Spec
.
Quobyte
,
out
)
printQuobyteVolumeSource
(
pv
.
Spec
.
Quobyte
,
out
)
case
pv
.
Spec
.
VsphereVolume
!=
nil
:
case
pv
.
Spec
.
VsphereVolume
!=
nil
:
printVsphereVolumeSource
(
pv
.
Spec
.
VsphereVolume
,
out
)
printVsphereVolumeSource
(
pv
.
Spec
.
VsphereVolume
,
out
)
case
pv
.
Spec
.
Cinder
!=
nil
:
printCinderVolumeSource
(
pv
.
Spec
.
Cinder
,
out
)
}
}
if
events
!=
nil
{
if
events
!=
nil
{
...
...
pkg/kubectl/describe_test.go
View file @
3fc8416e
...
@@ -537,6 +537,13 @@ func TestPersistentVolumeDescriber(t *testing.T) {
...
@@ -537,6 +537,13 @@ func TestPersistentVolumeDescriber(t *testing.T) {
},
},
},
},
},
},
"cinder"
:
{
Spec
:
api
.
PersistentVolumeSpec
{
PersistentVolumeSource
:
api
.
PersistentVolumeSource
{
Cinder
:
&
api
.
CinderVolumeSource
{},
},
},
},
}
}
for
name
,
pv
:=
range
tests
{
for
name
,
pv
:=
range
tests
{
...
...
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