diff --git a/pkg/kubelet/kuberuntime/helpers_test.go b/pkg/kubelet/kuberuntime/helpers_test.go index e4d59c2a18f..9de0544825f 100644 --- a/pkg/kubelet/kuberuntime/helpers_test.go +++ b/pkg/kubelet/kuberuntime/helpers_test.go @@ -194,8 +194,8 @@ func TestGetImageUser(t *testing.T) { i.Images[test.originalImage.name].Username = test.originalImage.username i.Images[test.originalImage.name].Uid = test.originalImage.uid - uid, username, error := m.getImageUser(test.originalImage.name) - assert.NoError(t, error, "TestCase[%d]", j) + uid, username, err := m.getImageUser(test.originalImage.name) + assert.NoError(t, err, "TestCase[%d]", j) if test.expectedImageUserValues.uid == (*int64)(nil) { assert.Equal(t, test.expectedImageUserValues.uid, uid, "TestCase[%d]", j) diff --git a/plugin/cmd/kube-scheduler/app/configurator_test.go b/plugin/cmd/kube-scheduler/app/configurator_test.go index 2dee043d8d9..c4bc1bd1424 100644 --- a/plugin/cmd/kube-scheduler/app/configurator_test.go +++ b/plugin/cmd/kube-scheduler/app/configurator_test.go @@ -24,8 +24,8 @@ func TestSchedulerConfiguratorFailure(t *testing.T) { sc := &schedulerConfigurator{ // policyfile and algorithm are intentionally undefined. } - _, error := sc.Create() - if error == nil { + _, err := sc.Create() + if err == nil { t.Fatalf("Expected error message when creating with incomplete configurator.") } } diff --git a/plugin/pkg/scheduler/core/generic_scheduler_test.go b/plugin/pkg/scheduler/core/generic_scheduler_test.go index 5255b12ff7e..48828b3bb98 100644 --- a/plugin/pkg/scheduler/core/generic_scheduler_test.go +++ b/plugin/pkg/scheduler/core/generic_scheduler_test.go @@ -402,7 +402,7 @@ func makeNode(node string, milliCPU, memory int64) *v1.Node { } func TestHumanReadableFitError(t *testing.T) { - error := &FitError{ + err := &FitError{ Pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "2"}}, FailedPredicates: FailedPredicateMap{ "1": []algorithm.PredicateFailureReason{algorithmpredicates.ErrNodeUnderMemoryPressure}, @@ -410,12 +410,12 @@ func TestHumanReadableFitError(t *testing.T) { "3": []algorithm.PredicateFailureReason{algorithmpredicates.ErrNodeUnderDiskPressure}, }, } - if strings.Contains(error.Error(), NoNodeAvailableMsg) { - if strings.Contains(error.Error(), "NodeUnderDiskPressure (2)") && strings.Contains(error.Error(), "NodeUnderMemoryPressure (1)") { + if strings.Contains(err.Error(), NoNodeAvailableMsg) { + if strings.Contains(err.Error(), "NodeUnderDiskPressure (2)") && strings.Contains(err.Error(), "NodeUnderMemoryPressure (1)") { return } } - t.Errorf("Error message doesn't have all the information content: [" + error.Error() + "]") + t.Errorf("Error message doesn't have all the information content: [" + err.Error() + "]") } // The point of this test is to show that you: