Merge pull request #46124 from humblec/cephfs-vol-source

Automatic merge from submit-queue (batch tested with PRs 46124, 46434, 46089, 45589, 46045)

Add CephFS volume source to describe printer.
This commit is contained in:
Kubernetes Submit Queue 2017-05-25 21:39:56 -07:00 committed by GitHub
commit b642ae2c18

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 {