Repository: kubernetes/klog (go)

Issue:
Fix `InfoS` serializing Stringer subfields
/kind bug

**What steps did you take and what happened:**

When migrating `Infof` to `InfoS` there was a regression in serializing Stringer subfields.
```
klog.V(2).Infof("status for pod %v updated to %v", p.Name, status)
```
was correctly migrated to 
```
klog.V(2).InfoS("Pod status updated", "pod", klog.KObj(p), "status", status)
```
Log output before migration
```
I0601 19:25:53.698080   16895 kubelet_getters.go:173] status for pod nginx-pod-127.0.0.1 updated to {Running [{Initialized True 0001-01-01 00:00:00 +0000 UTC 2020-06-01 19:18:54 +0900 JST  } {Ready True 0001-01-01 00:00:00 +0000 UTC 2020-06-01 19:18:54 +0900 JST  } {ContainersReady True 0001-01-01 00:00:00 +0000 UTC 2020-06-01 19:18:54 +0900 JST  } {PodScheduled True 0001-01-01 00:00:00 +0000 UTC 2020-06-01 19:18:54 +0900 JST  }]    127.0.0.1 172.17.0.4 [{172.17.0.4}] 2020-06-01 19:18:54 +0900 JST [] [{nginx-container {nil &ContainerStateRunning{StartedAt:2020-06-01 18:27:34 +0900 JST,} nil} {nil nil nil} true 0 nginx:latest docker-pullable://nginx@sha256:6fff55753e3b34e36e24e37039ee9eae1fe38a6420d8ae16ef37c92d1eb26699 docker://c729caca14fd6b19fb1fdbf5fe436352abd31c488a134fd5e56ee9fe7dc98eaa 0xc0012c2069}] BestEffort []}
```
log output after migration
```
I0601 19:45:29.666416   27921 kubelet_getters.go:173] "Pod status updated" pod="default/nginx-pod-127.0.0.1" status=v1.PodStatus{Phase:"Running", Conditions:[]v1.PodCondition{v1.PodCondition{Type:"Initialized", Status:"True", LastProbeTime:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, LastTransitionTime:v1.Time{Time:time.Time{wall:0x0, ext:63726604110, loc:(*time.Location)(0x750f720)}}, Reason:"", Message:""}, v1.PodCondition{Type:"Ready", Status:"True", LastProbeTime:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, LastTransitionTime:v1.Time{Time:time.Time{wall:0x0, ext:63726604110, loc:(*time.Location)(0x750f720)}}, Reason:"", Message:""}, v1.PodCondition{Type:"ContainersReady", Status:"True", LastProbeTime:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, LastTransitionTime:v1.Time{Time:time.Time{wall:0x0, ext:63726604110, loc:(*time.Location)(0x750f720)}}, Reason:"", Message:""}, v1.PodCondition{Type:"PodScheduled", Status:"True", LastProbeTime:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, LastTransitionTime:v1.Time{Time:time.Time{wall:0x0, ext:63726604110, loc:(*time.Location)(0x750f720)}}, Reason:"", Message:""}}, Message:"", Reason:"", NominatedNodeName:"", HostIP:"127.0.0.1", PodIP:"172.17.0.4", PodIPs:[]v1.PodIP{v1.PodIP{IP:"172.17.0.4"}}, StartTime:(*v1.Time)(0xc000d74220), InitContainerStatuses:[]v1.ContainerStatus(nil), ContainerStatuses:[]v1.ContainerStatus{v1.ContainerStatus{Name:"nginx-container", State:v1.ContainerState{Waiting:(*v1.ContainerStateWaiting)(nil), Running:(*v1.ContainerStateRunning)(0xc000d74200), Terminated:(*v1.ContainerStateTerminated)(nil)}, LastTerminationState:v1.ContainerState{Waiting:(*v1.ContainerStateWaiting)(nil), Running:(*v1.ContainerStateRunning)(nil), Terminated:(*v1.ContainerStateTerminated)(nil)}, Ready:true, RestartCount:0, Image:"nginx:latest", ImageID:"docker-pullable://nginx@sha256:6fff55753e3b34e36e24e37039ee9eae1fe38a6420d8ae16ef37c92d1eb26699", ContainerID:"docker://c729caca14fd6b19fb1fdbf5fe436352abd31c488a134fd5e56ee9fe7dc98eaa", Started:(*bool)(0xc000f7f1a9)}}, QOSClass:"BestEffort", EphemeralContainerStatuses:[]v1.ContainerStatus(nil)}
```

**What did you expect to happen:**
I would expect that type `time.Time` that implements stringer should be serialized using `.String()` instead of
`time.Time{wall:0x0, ext:63726604110, loc:(*time.Location)(0x750f720)}` 

**Anything else you would like to add:**
[Miscellaneous information that will assist in solving the issue.]


Pull request:
fix imported bug InfoS time encode format 
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://git.k8s.io/community/contributors/guide/pull-requests.md#the-pull-request-submit-process and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide
2. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews
3. Follow the instructions for writing a release note: https://git.k8s.io/community/contributors/guide/release-notes.md
4. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
5. If this PR changes image versions, please title this PR "Bump <image name> from x.x.x to y.y.y."
-->

**What this PR does / why we need it**:
fix imported bug time encode format form kvlistFormat
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #156 

**Special notes for your reviewer**:

_Please confirm that if this PR changes any image versions, then that's the sole change this PR makes._

**Release note**:
<!--  Write your release note:
1. Enter your extended release note in the below block. If the PR requires additional action from users switching to the new release, include the string "action required".
2. If no release note is required, just write "NONE".
-->
```release-note
NONE
```

Patch:
diff --git a/klog.go b/klog.go
index de49e85..ac3fbb0 100644
--- a/klog.go
+++ b/klog.go
@@ -800,10 +800,16 @@ func kvListFormat(b *bytes.Buffer, keysAndValues ...interface{}) {
 			v = missingValue
 		}
 		b.WriteByte(' ')
-		if _, ok := v.(fmt.Stringer); ok {
+
+		switch v.(type) {
+		case string:
 			b.WriteString(fmt.Sprintf("%s=%q", k, v))
-		} else {
-			b.WriteString(fmt.Sprintf("%s=%#v", k, v))
+		default:
+			if _, ok := v.(fmt.Stringer); ok {
+				b.WriteString(fmt.Sprintf("%s=%q", k, v))
+			} else {
+				b.WriteString(fmt.Sprintf("%s=%+v", k, v))
+			}
 		}
 	}
 }


Test patch:
diff --git a/klog_test.go b/klog_test.go
index 58b384e..40a0ca3 100644
--- a/klog_test.go
+++ b/klog_test.go
@@ -849,20 +849,21 @@ func TestKvListFormat(t *testing.T) {
 			keysValues: []interface{}{"pod", "kubedns", "spec", struct {
 				X int
 				Y string
-			}{X: 76, Y: "strval"}},
-			want: " pod=\"kubedns\" spec=struct { X int; Y string }{X:76, Y:\"strval\"}",
+				N time.Time
+			}{X: 76, Y: "strval", N: time.Date(2006, 1, 2, 15, 4, 5, .067890e9, time.UTC)}},
+			want: " pod=\"kubedns\" spec={X:76 Y:strval N:2006-01-02 15:04:05.06789 +0000 UTC}",
 		},
 		{
 			keysValues: []interface{}{"pod", "kubedns", "values", []int{8, 6, 7, 5, 3, 0, 9}},
-			want:       " pod=\"kubedns\" values=[]int{8, 6, 7, 5, 3, 0, 9}",
+			want:       " pod=\"kubedns\" values=[8 6 7 5 3 0 9]",
 		},
 		{
 			keysValues: []interface{}{"pod", "kubedns", "values", []string{"deployment", "svc", "configmap"}},
-			want:       " pod=\"kubedns\" values=[]string{\"deployment\", \"svc\", \"configmap\"}",
+			want:       " pod=\"kubedns\" values=[deployment svc configmap]",
 		},
 		{
 			keysValues: []interface{}{"pod", "kubedns", "maps", map[string]int{"three": 4}},
-			want:       " pod=\"kubedns\" maps=map[string]int{\"three\":4}",
+			want:       " pod=\"kubedns\" maps=map[three:4]",
 		},
 		{
 			keysValues: []interface{}{"pod", KRef("kube-system", "kubedns"), "status", "ready"},