From b32f816fd17a2ebb27d9ccb882c6935d660ebac9 Mon Sep 17 00:00:00 2001 From: Lukasz Zajaczkowski Date: Wed, 2 Oct 2024 13:22:05 +0200 Subject: [PATCH] fix linter --- pkg/controller/stacks/job_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/controller/stacks/job_test.go b/pkg/controller/stacks/job_test.go index 3bb56066..02625c3b 100644 --- a/pkg/controller/stacks/job_test.go +++ b/pkg/controller/stacks/job_test.go @@ -19,6 +19,8 @@ import ( "github.com/pluralsh/deployment-operator/pkg/test/mocks" ) +const defaultName = "default" + func TestGetDefaultContainerImage(t *testing.T) { var kClient client.Client fakeConsoleClient := mocks.NewClientMock(t) @@ -113,7 +115,7 @@ func TestGetDefaultContainerImage(t *testing.T) { func TestGenerateRunJob(t *testing.T) { var kClient client.Client fakeConsoleClient := mocks.NewClientMock(t) - namespace := "default" + namespace := defaultName runID := "1" reconciler := NewStackReconciler(fakeConsoleClient, kClient, scheme.Scheme, time.Minute, 0, namespace, "", "") cases := []struct { @@ -175,12 +177,12 @@ func TestGenerateRunJob(t *testing.T) { Configuration: console.StackConfigurationFragment{}, JobSpec: &console.JobSpecFragment{ Namespace: namespace, - ServiceAccount: lo.ToPtr("default"), + ServiceAccount: lo.ToPtr(defaultName), }, }, expectedJobSpec: func() batchv1.JobSpec { js := genDefaultJobSpec(namespace, "add_sa", runID) - js.Template.Spec.ServiceAccountName = "default" + js.Template.Spec.ServiceAccountName = defaultName return js }(), }, @@ -241,7 +243,7 @@ func genDefaultJobSpec(namespace, name, runID string) batchv1.JobSpec { Spec: corev1.PodSpec{ Containers: []corev1.Container{ { - Name: "default", + Name: defaultName, Image: "ghcr.io/pluralsh/harness:0.4.29-terraform-1.8.2", WorkingDir: "", EnvFrom: []corev1.EnvFromSource{