Add CephFS volume source to describe printer.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
Humble Chirammal 2017-05-23 20:27:00 +05:30
parent 8e07e61a43
commit 8700776d26

View File

@ -735,6 +735,8 @@ func describeVolumes(volumes []api.Volume, w PrefixWriter, space string) {
printPortworxVolumeSource(volume.VolumeSource.PortworxVolume, w)
case volume.VolumeSource.ScaleIO != nil:
printScaleIOVolumeSource(volume.VolumeSource.ScaleIO, w)
case volume.VolumeSource.CephFS != nil:
printCephFSVolumeSource(volume.VolumeSource.CephFS, w)
default:
w.Write(LEVEL_1, "<unknown>\n")
}
@ -922,6 +924,17 @@ func printLocalVolumeSource(ls *api.LocalVolumeSource, w PrefixWriter) {
ls.Path)
}
func printCephFSVolumeSource(cephfs *api.CephFSVolumeSource, w PrefixWriter) {
w.Write(LEVEL_2, "Type:\tCephFS (a CephFS mount on the host that shares a pod's lifetime)\n"+
" Monitors:\t%v\n"+
" Path:\t%v\n"+
" User:\t%v\n"+
" SecretFile:\t%v\n"+
" SecretRef:\t%v\n"+
" ReadOnly:\t%v\n",
cephfs.Monitors, cephfs.Path, cephfs.User, cephfs.SecretFile, cephfs.SecretRef, cephfs.ReadOnly)
}
type PersistentVolumeDescriber struct {
clientset.Interface
}
@ -993,6 +1006,8 @@ func describePersistentVolume(pv *api.PersistentVolume, events *api.EventList) (
printScaleIOVolumeSource(pv.Spec.ScaleIO, w)
case pv.Spec.Local != nil:
printLocalVolumeSource(pv.Spec.Local, w)
case pv.Spec.CephFS != nil:
printCephFSVolumeSource(pv.Spec.CephFS, w)
}
if events != nil {