Merge pull request #22129 from pmorie/kubectl-describe-volumes

Auto commit by PR queue bot
pull/6/head
k8s-merge-robot 2016-03-02 09:10:48 -08:00
commit 7f9ee58550
1 changed files with 9 additions and 0 deletions

View File

@ -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
}