Merge pull request #21688 from pmorie/kubectl-describe-pod-config

Add describe output for ConfigMap volumes
This commit is contained in:
Fabio Yeon 2016-02-26 13:16:49 -08:00
commit caf7b9eba7

View File

@ -529,6 +529,8 @@ func describeVolumes(volumes []api.Volume, out io.Writer) {
printGitRepoVolumeSource(volume.VolumeSource.GitRepo, out)
case volume.VolumeSource.Secret != nil:
printSecretVolumeSource(volume.VolumeSource.Secret, out)
case volume.VolumeSource.ConfigMap != nil:
printConfigMapVolumeSource(volume.VolumeSource.ConfigMap, out)
case volume.VolumeSource.NFS != nil:
printNFSVolumeSource(volume.VolumeSource.NFS, out)
case volume.VolumeSource.ISCSI != nil:
@ -581,10 +583,15 @@ func printGitRepoVolumeSource(git *api.GitRepoVolumeSource, out io.Writer) {
}
func printSecretVolumeSource(secret *api.SecretVolumeSource, out io.Writer) {
fmt.Fprintf(out, " Type:\tSecret (a secret that should populate this volume)\n"+
fmt.Fprintf(out, " Type:\tSecret (a volume populated by a Secret)\n"+
" SecretName:\t%v\n", secret.SecretName)
}
func printConfigMapVolumeSource(configMap *api.ConfigMapVolumeSource, out io.Writer) {
fmt.Fprintf(out, " Type:\tConfigMap (a volume populated by a ConfigMap)\n"+
" Name:\t%v\n", configMap.Name)
}
func printNFSVolumeSource(nfs *api.NFSVolumeSource, out io.Writer) {
fmt.Fprintf(out, " Type:\tNFS (an NFS mount that lasts the lifetime of a pod)\n"+
" Server:\t%v\n"+