From 8700776d261944b20db40e66f73567f90cc3ce5c Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Tue, 23 May 2017 20:27:00 +0530 Subject: [PATCH] Add CephFS volume source to describe printer. Signed-off-by: Humble Chirammal --- pkg/printers/internalversion/describe.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkg/printers/internalversion/describe.go b/pkg/printers/internalversion/describe.go index 7385344f87e..2652e0ef75e 100644 --- a/pkg/printers/internalversion/describe.go +++ b/pkg/printers/internalversion/describe.go @@ -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, "\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 {