diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 2f8376d8e07..ea9d93f9457 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -224,11 +224,9 @@ func DeleteNamespaces(c clientset.Interface, deleteFilter, skipFilter []string) var wg sync.WaitGroup OUTER: for _, item := range nsList.Items { - if skipFilter != nil { - for _, pattern := range skipFilter { - if strings.Contains(item.Name, pattern) { - continue OUTER - } + for _, pattern := range skipFilter { + if strings.Contains(item.Name, pattern) { + continue OUTER } } if deleteFilter != nil { diff --git a/test/e2e_node/services/services.go b/test/e2e_node/services/services.go index e0af8d2aa09..3eb56fe1ac3 100644 --- a/test/e2e_node/services/services.go +++ b/test/e2e_node/services/services.go @@ -93,12 +93,10 @@ func (e *E2EServices) Stop() { klog.Errorf("Failed to stop kubelet: %v", err) } } - if e.rmDirs != nil { - for _, d := range e.rmDirs { - err := os.RemoveAll(d) - if err != nil { - klog.Errorf("Failed to delete directory %s: %v", d, err) - } + for _, d := range e.rmDirs { + err := os.RemoveAll(d) + if err != nil { + klog.Errorf("Failed to delete directory %s: %v", d, err) } } } diff --git a/test/integration/apiserver/admissionwebhook/reinvocation_test.go b/test/integration/apiserver/admissionwebhook/reinvocation_test.go index 8688cb67ac1..40db2ea198c 100644 --- a/test/integration/apiserver/admissionwebhook/reinvocation_test.go +++ b/test/integration/apiserver/admissionwebhook/reinvocation_test.go @@ -447,11 +447,9 @@ func testWebhookReinvocationPolicy(t *testing.T, watchCache bool) { } } - if tt.expectInvocations != nil { - for k, v := range tt.expectInvocations { - if recorder.GetCount(k) != v { - t.Errorf("expected %d invocations of %s, but got %d", v, k, recorder.GetCount(k)) - } + for k, v := range tt.expectInvocations { + if recorder.GetCount(k) != v { + t.Errorf("expected %d invocations of %s, but got %d", v, k, recorder.GetCount(k)) } }