Commit b642ae2c authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

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.
parents d0dfd8c4 8700776d
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment