diff --git a/pkg/controller/testutil/test_utils.go b/pkg/controller/testutil/test_utils.go index be13e4637a..dd8f118289 100644 --- a/pkg/controller/testutil/test_utils.go +++ b/pkg/controller/testutil/test_utils.go @@ -374,7 +374,7 @@ func (f *FakeRecorder) PastEventf(obj runtime.Object, timestamp metav1.Time, eve // AnnotatedEventf emits a fake formatted event to the fake recorder func (f *FakeRecorder) AnnotatedEventf(obj runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{}) { - f.Eventf(obj, eventtype, reason, messageFmt, args) + f.Eventf(obj, eventtype, reason, messageFmt, args...) } func (f *FakeRecorder) generateEvent(obj runtime.Object, timestamp metav1.Time, eventtype, reason, message string) { diff --git a/pkg/kubelet/container/sync_result_test.go b/pkg/kubelet/container/sync_result_test.go index 56f191d3d5..d39283706e 100644 --- a/pkg/kubelet/container/sync_result_test.go +++ b/pkg/kubelet/container/sync_result_test.go @@ -45,7 +45,7 @@ func TestPodSyncResult(t *testing.T) { result.AddSyncResult(okResults...) result.AddSyncResult(errResults...) if result.Error() == nil { - t.Errorf("PodSyncResult should be error: %q", result) + t.Errorf("PodSyncResult should be error: %v", result) } // If the PodSyncResult is failed, it should be error @@ -53,7 +53,7 @@ func TestPodSyncResult(t *testing.T) { result.AddSyncResult(okResults...) result.Fail(errors.New("error")) if result.Error() == nil { - t.Errorf("PodSyncResult should be error: %q", result) + t.Errorf("PodSyncResult should be error: %v", result) } // If the PodSyncResult is added an error PodSyncResult, it should be error @@ -63,6 +63,6 @@ func TestPodSyncResult(t *testing.T) { result.AddSyncResult(okResults...) result.AddPodSyncResult(errResult) if result.Error() == nil { - t.Errorf("PodSyncResult should be error: %q", result) + t.Errorf("PodSyncResult should be error: %v", result) } } diff --git a/pkg/kubelet/kuberuntime/kuberuntime_manager_test.go b/pkg/kubelet/kuberuntime/kuberuntime_manager_test.go index 42f447765f..4266eae13c 100644 --- a/pkg/kubelet/kuberuntime/kuberuntime_manager_test.go +++ b/pkg/kubelet/kuberuntime/kuberuntime_manager_test.go @@ -384,7 +384,7 @@ func TestGetPods(t *testing.T) { assert.NoError(t, err) if !verifyPods(expected, actual) { - t.Errorf("expected %q, got %q", expected, actual) + t.Errorf("expected %#v, got %#v", expected, actual) } } diff --git a/pkg/registry/core/service/allocator/utils_test.go b/pkg/registry/core/service/allocator/utils_test.go index 9ec711d83d..5f87cb1831 100644 --- a/pkg/registry/core/service/allocator/utils_test.go +++ b/pkg/registry/core/service/allocator/utils_test.go @@ -46,7 +46,7 @@ func TestCountBits(t *testing.T) { for _, test := range tests { actual := countBits(test.n) if test.expected != actual { - t.Errorf("%d should have %d bits but recorded as %d", test.n, test.expected, actual) + t.Errorf("%s should have %d bits but recorded as %d", test.n, test.expected, actual) } } }