diff --git a/deploy/helm/sumologic/templates/_helpers/_common.tpl b/deploy/helm/sumologic/templates/_helpers/_common.tpl index b24a9ff09..423ad21e1 100644 --- a/deploy/helm/sumologic/templates/_helpers/_common.tpl +++ b/deploy/helm/sumologic/templates/_helpers/_common.tpl @@ -79,6 +79,10 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- template "sumologic.labels.app" . }} {{- end -}} +{{- define "sumologic.labels.app.setup.pods" -}} +sumologic.com/app: setup +{{- end -}} + {{- define "sumologic.labels.app.setup.job" -}} {{- template "sumologic.labels.app.setup" . }} {{- end -}} diff --git a/deploy/helm/sumologic/templates/setup/job.yaml b/deploy/helm/sumologic/templates/setup/job.yaml index 9a1093cdc..dc18adf21 100644 --- a/deploy/helm/sumologic/templates/setup/job.yaml +++ b/deploy/helm/sumologic/templates/setup/job.yaml @@ -15,6 +15,7 @@ metadata: labels: app: {{ template "sumologic.labels.app.setup.job" . }} {{- include "sumologic.labels.common" . | nindent 4 }} + {{- include "sumologic.labels.app.setup.pods" . | nindent 4 }} spec: ttlSecondsAfterFinished: {{ .Values.sumologic.setup.job.ttlSecondsAfterFinished }} template: @@ -27,6 +28,7 @@ spec: {{ toYaml .Values.sumologic.setup.job.podAnnotations | indent 8 }} {{- end }} labels: +{{- include "sumologic.labels.app.setup.pods" . | nindent 8 }} {{- if .Values.sumologic.podLabels }} {{ toYaml .Values.sumologic.podLabels | indent 8 }} {{- end }} diff --git a/tests/helm/testdata/goldenfile/setup/basic.output.yaml b/tests/helm/testdata/goldenfile/setup/basic.output.yaml index d8b9034d8..799541307 100644 --- a/tests/helm/testdata/goldenfile/setup/basic.output.yaml +++ b/tests/helm/testdata/goldenfile/setup/basic.output.yaml @@ -14,12 +14,14 @@ metadata: chart: "sumologic-%CURRENT_CHART_VERSION%" release: "RELEASE-NAME" heritage: "Helm" + sumologic.com/app: "setup" spec: ttlSecondsAfterFinished: 120 template: metadata: annotations: labels: + sumologic.com/app: "setup" spec: restartPolicy: OnFailure serviceAccountName: RELEASE-NAME-sumologic-setup diff --git a/tests/helm/testdata/goldenfile/setup/monitors_with_email_notifications.output.yaml b/tests/helm/testdata/goldenfile/setup/monitors_with_email_notifications.output.yaml index a74f846af..b4037e20b 100644 --- a/tests/helm/testdata/goldenfile/setup/monitors_with_email_notifications.output.yaml +++ b/tests/helm/testdata/goldenfile/setup/monitors_with_email_notifications.output.yaml @@ -14,12 +14,14 @@ metadata: chart: "sumologic-%CURRENT_CHART_VERSION%" release: "RELEASE-NAME" heritage: "Helm" + sumologic.com/app: "setup" spec: ttlSecondsAfterFinished: 120 template: metadata: annotations: labels: + sumologic.com/app: "setup" spec: restartPolicy: OnFailure serviceAccountName: RELEASE-NAME-sumologic-setup diff --git a/tests/helm/testdata/goldenfile/setup/monitors_with_single_email.output.yaml b/tests/helm/testdata/goldenfile/setup/monitors_with_single_email.output.yaml index 03ee27dca..454042e9f 100644 --- a/tests/helm/testdata/goldenfile/setup/monitors_with_single_email.output.yaml +++ b/tests/helm/testdata/goldenfile/setup/monitors_with_single_email.output.yaml @@ -14,12 +14,14 @@ metadata: chart: "sumologic-%CURRENT_CHART_VERSION%" release: "RELEASE-NAME" heritage: "Helm" + sumologic.com/app: "setup" spec: ttlSecondsAfterFinished: 120 template: metadata: annotations: labels: + sumologic.com/app: "setup" spec: restartPolicy: OnFailure serviceAccountName: RELEASE-NAME-sumologic-setup diff --git a/tests/helm/testdata/goldenfile/setup/sumologic-mock-no-secret.output.yaml b/tests/helm/testdata/goldenfile/setup/sumologic-mock-no-secret.output.yaml index 9249f0e93..080e9b942 100644 --- a/tests/helm/testdata/goldenfile/setup/sumologic-mock-no-secret.output.yaml +++ b/tests/helm/testdata/goldenfile/setup/sumologic-mock-no-secret.output.yaml @@ -14,12 +14,14 @@ metadata: chart: "sumologic-%CURRENT_CHART_VERSION%" release: "RELEASE-NAME" heritage: "Helm" + sumologic.com/app: "setup" spec: ttlSecondsAfterFinished: 120 template: metadata: annotations: labels: + sumologic.com/app: "setup" spec: restartPolicy: OnFailure serviceAccountName: RELEASE-NAME-sumologic-setup diff --git a/tests/helm/testdata/goldenfile/setup/sumologic-mock.output.yaml b/tests/helm/testdata/goldenfile/setup/sumologic-mock.output.yaml index 9249f0e93..080e9b942 100644 --- a/tests/helm/testdata/goldenfile/setup/sumologic-mock.output.yaml +++ b/tests/helm/testdata/goldenfile/setup/sumologic-mock.output.yaml @@ -14,12 +14,14 @@ metadata: chart: "sumologic-%CURRENT_CHART_VERSION%" release: "RELEASE-NAME" heritage: "Helm" + sumologic.com/app: "setup" spec: ttlSecondsAfterFinished: 120 template: metadata: annotations: labels: + sumologic.com/app: "setup" spec: restartPolicy: OnFailure serviceAccountName: RELEASE-NAME-sumologic-setup