Fix printISCSIVolumeSource to show kubectl describe properly

Fixes #51635
pull/6/head
mtanino 2017-08-30 12:20:58 -04:00
parent 022919d1a4
commit f1b9e3e6e3
1 changed files with 6 additions and 2 deletions

View File

@ -835,6 +835,10 @@ func printPortworxVolumeSource(pwxVolume *api.PortworxVolumeSource, w PrefixWrit
} }
func printISCSIVolumeSource(iscsi *api.ISCSIVolumeSource, w PrefixWriter) { func printISCSIVolumeSource(iscsi *api.ISCSIVolumeSource, w PrefixWriter) {
initiator := "<none>"
if iscsi.InitiatorName != nil {
initiator = *iscsi.InitiatorName
}
w.Write(LEVEL_2, "Type:\tISCSI (an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod)\n"+ w.Write(LEVEL_2, "Type:\tISCSI (an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod)\n"+
" TargetPortal:\t%v\n"+ " TargetPortal:\t%v\n"+
" IQN:\t%v\n"+ " IQN:\t%v\n"+
@ -845,9 +849,9 @@ func printISCSIVolumeSource(iscsi *api.ISCSIVolumeSource, w PrefixWriter) {
" Portals:\t%v\n"+ " Portals:\t%v\n"+
" DiscoveryCHAPAuth:\t%v\n"+ " DiscoveryCHAPAuth:\t%v\n"+
" SessionCHAPAuth:\t%v\n"+ " SessionCHAPAuth:\t%v\n"+
" SecretRef:\t%v\n", " SecretRef:\t%v\n"+
" InitiatorName:\t%v\n", " InitiatorName:\t%v\n",
iscsi.TargetPortal, iscsi.IQN, iscsi.Lun, iscsi.ISCSIInterface, iscsi.FSType, iscsi.ReadOnly, iscsi.Portals, iscsi.DiscoveryCHAPAuth, iscsi.SessionCHAPAuth, iscsi.SecretRef, iscsi.InitiatorName) iscsi.TargetPortal, iscsi.IQN, iscsi.Lun, iscsi.ISCSIInterface, iscsi.FSType, iscsi.ReadOnly, iscsi.Portals, iscsi.DiscoveryCHAPAuth, iscsi.SessionCHAPAuth, iscsi.SecretRef, initiator)
} }
func printGlusterfsVolumeSource(glusterfs *api.GlusterfsVolumeSource, w PrefixWriter) { func printGlusterfsVolumeSource(glusterfs *api.GlusterfsVolumeSource, w PrefixWriter) {