mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Merge pull request #22129 from pmorie/kubectl-describe-volumes
Auto commit by PR queue bot
This commit is contained in:
commit
7f9ee58550
@ -574,6 +574,8 @@ func describeVolumes(volumes []api.Volume, out io.Writer) {
|
|||||||
printPersistentVolumeClaimVolumeSource(volume.VolumeSource.PersistentVolumeClaim, out)
|
printPersistentVolumeClaimVolumeSource(volume.VolumeSource.PersistentVolumeClaim, out)
|
||||||
case volume.VolumeSource.RBD != nil:
|
case volume.VolumeSource.RBD != nil:
|
||||||
printRBDVolumeSource(volume.VolumeSource.RBD, out)
|
printRBDVolumeSource(volume.VolumeSource.RBD, out)
|
||||||
|
case volume.VolumeSource.DownwardAPI != nil:
|
||||||
|
printDownwardAPIVolumeSource(volume.VolumeSource.DownwardAPI, out)
|
||||||
default:
|
default:
|
||||||
fmt.Fprintf(out, " <Volume Type Not Found>\n")
|
fmt.Fprintf(out, " <Volume Type Not Found>\n")
|
||||||
}
|
}
|
||||||
@ -672,6 +674,13 @@ func printRBDVolumeSource(rbd *api.RBDVolumeSource, out io.Writer) {
|
|||||||
rbd.CephMonitors, rbd.RBDImage, rbd.FSType, rbd.RBDPool, rbd.RadosUser, rbd.Keyring, rbd.SecretRef, rbd.ReadOnly)
|
rbd.CephMonitors, rbd.RBDImage, rbd.FSType, rbd.RBDPool, rbd.RadosUser, rbd.Keyring, rbd.SecretRef, rbd.ReadOnly)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func printDownwardAPIVolumeSource(d *api.DownwardAPIVolumeSource, out io.Writer) {
|
||||||
|
fmt.Fprintf(out, " Type:\tDownwardAPI (a volume populated by information about the pod)\n Items:\n")
|
||||||
|
for _, mapping := range d.Items {
|
||||||
|
fmt.Fprintf(out, " %v -> %v\n", mapping.FieldRef.FieldPath, mapping.Path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
type PersistentVolumeDescriber struct {
|
type PersistentVolumeDescriber struct {
|
||||||
client.Interface
|
client.Interface
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user