diff --git a/master/internal/rm/kubernetesrm/jobs_test.go b/master/internal/rm/kubernetesrm/jobs_test.go index 15d304e1a9d..983b53470c7 100644 --- a/master/internal/rm/kubernetesrm/jobs_test.go +++ b/master/internal/rm/kubernetesrm/jobs_test.go @@ -123,8 +123,8 @@ func TestListPodsInAllNamespaces(t *testing.T) { }, } - var expectedPods []k8sV1.Pod - copy(expectedPods, append(detPods, outsidePod)) + //nolint:gocritic + expectedPods := append(detPods, outsidePod) expectedPodList := k8sV1.PodList{Items: expectedPods} emptyNS.On("List", mock.Anything, mock.Anything).Once(). Return(&k8sV1.PodList{Items: expectedPods}, nil) @@ -133,7 +133,7 @@ func TestListPodsInAllNamespaces(t *testing.T) { opts := metaV1.ListOptions{} actualPodList, err := js.listPodsInAllNamespaces(ctx, opts) require.NoError(t, err) - require.NotNil(t, actualPodList) + require.NotEmpty(t, actualPodList) require.ElementsMatch(t, expectedPodList.Items, actualPodList) forbiddenErr := k8error.NewForbidden(schema.GroupResource{}, "forbidden", @@ -204,8 +204,8 @@ func TestHealthStatus(t *testing.T) { }, } - var expectedPods []k8sV1.Pod - copy(expectedPods, append(detPods, outsidePod)) + //nolint:gocritic + expectedPods := append(detPods, outsidePod) emptyNS.On("List", mock.Anything, mock.Anything).Once(). Return(&k8sV1.PodList{Items: expectedPods}, nil) diff --git a/master/internal/rm/kubernetesrm/kubernetes_resource_manager_intg_test.go b/master/internal/rm/kubernetesrm/kubernetes_resource_manager_intg_test.go index 55824f29a13..ab36f0b5e3e 100644 --- a/master/internal/rm/kubernetesrm/kubernetes_resource_manager_intg_test.go +++ b/master/internal/rm/kubernetesrm/kubernetes_resource_manager_intg_test.go @@ -778,6 +778,7 @@ func TestHealthCheck(t *testing.T) { jobsService: &jobsService{ podInterfaces: map[string]typedV1.PodInterface{ "namespace": mockPodInterface, + "": mockPodInterface, }, syslog: logrus.WithField("namespace", "test"), },