mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
Merge pull request #31045 from abrarshivani/vsphere_describe_volume
Automatic merge from submit-queue Add kubectl describe cmd support for vSphere volume This PR does following, Add kubectl describe cmd support for vSphere volume Examples: > kubectl describe pod redis ....... Volumes: vmdk-storage: Type: vSphereVolume (a Persistent Disk resource in vSphere) VolumePath: [Datastore] test1 FSType: ext4 ......... > kubectl describe pv pv0001 Name: pv0001 Labels: <none> Status: Available Claim: Reclaim Policy: Recycle Access Modes: RWO Capacity: 2Gi Message: Source: Type: vSphereVolume (a Persistent Disk resource in vSphere) VolumePath: [vsanDatastore] volumes/test11 FSType: ext4 No events.
This commit is contained in:
commit
63495d785b
@ -610,6 +610,8 @@ func describeVolumes(volumes []api.Volume, out io.Writer, space string) {
|
|||||||
printDownwardAPIVolumeSource(volume.VolumeSource.DownwardAPI, out)
|
printDownwardAPIVolumeSource(volume.VolumeSource.DownwardAPI, out)
|
||||||
case volume.VolumeSource.AzureDisk != nil:
|
case volume.VolumeSource.AzureDisk != nil:
|
||||||
printAzureDiskVolumeSource(volume.VolumeSource.AzureDisk, out)
|
printAzureDiskVolumeSource(volume.VolumeSource.AzureDisk, out)
|
||||||
|
case volume.VolumeSource.VsphereVolume != nil:
|
||||||
|
printVsphereVolumeSource(volume.VolumeSource.VsphereVolume, out)
|
||||||
default:
|
default:
|
||||||
fmt.Fprintf(out, " <unknown>\n")
|
fmt.Fprintf(out, " <unknown>\n")
|
||||||
}
|
}
|
||||||
@ -738,6 +740,13 @@ func printAzureDiskVolumeSource(d *api.AzureDiskVolumeSource, out io.Writer) {
|
|||||||
d.DiskName, d.DataDiskURI, *d.FSType, *d.CachingMode, *d.ReadOnly)
|
d.DiskName, d.DataDiskURI, *d.FSType, *d.CachingMode, *d.ReadOnly)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func printVsphereVolumeSource(vsphere *api.VsphereVirtualDiskVolumeSource, out io.Writer) {
|
||||||
|
fmt.Fprintf(out, " Type:\tvSphereVolume (a Persistent Disk resource in vSphere)\n"+
|
||||||
|
" VolumePath:\t%v\n"+
|
||||||
|
" FSType:\t%v\n",
|
||||||
|
vsphere.VolumePath, vsphere.FSType)
|
||||||
|
}
|
||||||
|
|
||||||
type PersistentVolumeDescriber struct {
|
type PersistentVolumeDescriber struct {
|
||||||
client.Interface
|
client.Interface
|
||||||
}
|
}
|
||||||
@ -789,6 +798,8 @@ func (d *PersistentVolumeDescriber) Describe(namespace, name string, describerSe
|
|||||||
printRBDVolumeSource(pv.Spec.RBD, out)
|
printRBDVolumeSource(pv.Spec.RBD, out)
|
||||||
case pv.Spec.Quobyte != nil:
|
case pv.Spec.Quobyte != nil:
|
||||||
printQuobyteVolumeSource(pv.Spec.Quobyte, out)
|
printQuobyteVolumeSource(pv.Spec.Quobyte, out)
|
||||||
|
case pv.Spec.VsphereVolume != nil:
|
||||||
|
printVsphereVolumeSource(pv.Spec.VsphereVolume, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
if events != nil {
|
if events != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user