Merge pull request #57202 from php-coder/fix_vsphere_volume_describer

Automatic merge from submit-queue (batch tested with PRs 55977, 56198, 57202, 57254, 57214). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix format string in describers

**What this PR does / why we need it**:
This PR fixes bug in the Vsphere Volume Source and other describers.

Before this fix `kubectl describe` could show something like this:
```
Source:
	Type:       vSphereVolume (a Persistent Disk resource in vSphere)
	VolumePath:     StoragePolicyName:  %v

	FSType:                             volumes/PVDISK_001
%!(EXTRA string=ext4, string=)Events:   <none>
```
It happened because format string was accidentally split to 2 strings and was interpreted in a wrong way.

**Release note**:
```release-note
NONE
```

CC @simo5
This commit is contained in:
Kubernetes Submit Queue 2017-12-17 08:26:50 -08:00 committed by GitHub
commit 403a3fa10a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -943,7 +943,7 @@ func printAzureDiskVolumeSource(d *api.AzureDiskVolumeSource, w PrefixWriter) {
func printVsphereVolumeSource(vsphere *api.VsphereVirtualDiskVolumeSource, w PrefixWriter) {
w.Write(LEVEL_2, "Type:\tvSphereVolume (a Persistent Disk resource in vSphere)\n"+
" VolumePath:\t%v\n"+
" FSType:\t%v\n",
" FSType:\t%v\n"+
" StoragePolicyName:\t%v\n",
vsphere.VolumePath, vsphere.FSType, vsphere.StoragePolicyName)
}
@ -1091,7 +1091,7 @@ func printFlexVolumeSource(flex *api.FlexVolumeSource, w PrefixWriter) {
" Driver:\t%v\n"+
" FSType:\t%v\n"+
" SecretRef:\t%v\n"+
" ReadOnly:\t%v\n",
" ReadOnly:\t%v\n"+
" Options:\t%v\n",
flex.Driver, flex.FSType, flex.SecretRef, flex.ReadOnly, flex.Options)
}
@ -1106,7 +1106,7 @@ func printFlockerVolumeSource(flocker *api.FlockerVolumeSource, w PrefixWriter)
func printCSIPersistentVolumeSource(csi *api.CSIPersistentVolumeSource, w PrefixWriter) {
w.Write(LEVEL_2, "Type:\tCSI (a Container Storage Interface (CSI) volume source)\n"+
" Driver:\t%v\n"+
" VolumeHandle:\t%v\n",
" VolumeHandle:\t%v\n"+
" ReadOnly:\t%v\n",
csi.Driver, csi.VolumeHandle, csi.ReadOnly)
}