mirror of https://github.com/k3s-io/k3s
Merge pull request #22129 from pmorie/kubectl-describe-volumes
Auto commit by PR queue botpull/6/head
commit
7f9ee58550
|
@ -574,6 +574,8 @@ func describeVolumes(volumes []api.Volume, out io.Writer) {
|
|||
printPersistentVolumeClaimVolumeSource(volume.VolumeSource.PersistentVolumeClaim, out)
|
||||
case volume.VolumeSource.RBD != nil:
|
||||
printRBDVolumeSource(volume.VolumeSource.RBD, out)
|
||||
case volume.VolumeSource.DownwardAPI != nil:
|
||||
printDownwardAPIVolumeSource(volume.VolumeSource.DownwardAPI, out)
|
||||
default:
|
||||
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)
|
||||
}
|
||||
|
||||
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 {
|
||||
client.Interface
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue