diff --git a/pkg/cmd/adm/restart.go b/pkg/cmd/adm/restart.go index c3738dd..af7ebb7 100644 --- a/pkg/cmd/adm/restart.go +++ b/pkg/cmd/adm/restart.go @@ -106,6 +106,7 @@ func deletePods(ctx *clicontext.CommandContext, cl runtimeclient.Client, deploym //delete pods for _, pod := range pods.Items { + pod := pod // TODO We won't need it after upgrading to go 1.22: https://go.dev/blog/loopvar-preview if err := cl.Delete(ctx, &pod); err != nil { return err } diff --git a/pkg/cmd/adm/restart_test.go b/pkg/cmd/adm/restart_test.go index e7e4b99..0bb2b23 100644 --- a/pkg/cmd/adm/restart_test.go +++ b/pkg/cmd/adm/restart_test.go @@ -155,7 +155,7 @@ func TestRestartHostOperator(t *testing.T) { t.Run("host deployment is present and restart successful", func(t *testing.T) { // given deployment := newDeployment(namespacedName, 1) - deployment.Labels = map[string]string{"olm.owner.kind": "ClusterServiceVersion"} + deployment.Labels = map[string]string{"provider": "codeready-toolchain"} newClient, fakeClient := NewFakeClients(t, deployment) numberOfUpdateCalls := 0 fakeClient.MockUpdate = requireDeploymentBeingUpdated(t, fakeClient, namespacedName, 1, &numberOfUpdateCalls)