diff --git a/pkg/resources/jobs/initializer.go b/pkg/resources/jobs/initializer.go index 865c54ab..370d508f 100644 --- a/pkg/resources/jobs/initializer.go +++ b/pkg/resources/jobs/initializer.go @@ -20,7 +20,6 @@ func NewInitializerJob(k6 *v1alpha1.K6, argLine string) (*batchv1.Job, error) { var ( image = "ghcr.io/grafana/operator:latest-runner" - annotations = make(map[string]string) labels = newLabels(k6.Name) serviceAccountName = "default" automountServiceAccountToken = true @@ -31,10 +30,6 @@ func NewInitializerJob(k6 *v1alpha1.K6, argLine string) (*batchv1.Job, error) { image = k6.Spec.Runner.Image } - if k6.Spec.Runner.Metadata.Annotations != nil { - annotations = k6.Spec.Runner.Metadata.Annotations - } - if k6.Spec.Runner.Metadata.Labels != nil { for k, v := range k6.Spec.Runner.Metadata.Labels { // Order not specified if _, ok := labels[k]; !ok { @@ -66,16 +61,14 @@ func NewInitializerJob(k6 *v1alpha1.K6, argLine string) (*batchv1.Job, error) { return &batchv1.Job{ ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("%s-initializer", k6.Name), - Namespace: k6.Namespace, - Labels: labels, - Annotations: annotations, + Name: fmt.Sprintf("%s-initializer", k6.Name), + Namespace: k6.Namespace, + Labels: labels, }, Spec: batchv1.JobSpec{ Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Labels: labels, - Annotations: annotations, + Labels: labels, }, Spec: corev1.PodSpec{ AutomountServiceAccountToken: &automountServiceAccountToken, diff --git a/pkg/resources/jobs/initializer_test.go b/pkg/resources/jobs/initializer_test.go index 36bfa35a..970c25fb 100644 --- a/pkg/resources/jobs/initializer_test.go +++ b/pkg/resources/jobs/initializer_test.go @@ -29,9 +29,6 @@ func TestNewInitializerJob(t *testing.T) { "k6_cr": "test", "label1": "awesome", }, - Annotations: map[string]string{ - "awesomeAnnotation": "dope", - }, }, Spec: batchv1.JobSpec{ Template: corev1.PodTemplateSpec{ @@ -41,9 +38,6 @@ func TestNewInitializerJob(t *testing.T) { "k6_cr": "test", "label1": "awesome", }, - Annotations: map[string]string{ - "awesomeAnnotation": "dope", - }, }, Spec: corev1.PodSpec{ AutomountServiceAccountToken: &automountServiceAccountToken,