Skip to content

Commit

Permalink
[AUTO-BACKPORT release-0.38.0] 10224: fix: make some k8s tests pass (#…
Browse files Browse the repository at this point in the history
…10228)

Co-authored-by: Max Russell <[email protected]>
  • Loading branch information
github-actions[bot] and maxrussell authored Nov 21, 2024
1 parent 0d373b1 commit a554cd0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions master/internal/rm/kubernetesrm/jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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",
Expand Down Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ func TestHealthCheck(t *testing.T) {
jobsService: &jobsService{
podInterfaces: map[string]typedV1.PodInterface{
"namespace": mockPodInterface,
"": mockPodInterface,
},
syslog: logrus.WithField("namespace", "test"),
},
Expand Down

0 comments on commit a554cd0

Please sign in to comment.