From 0cb180b3f21f8353313a4f84b3acb59a434a6747 Mon Sep 17 00:00:00 2001 From: Katarzyna Kujawa Date: Fri, 14 Apr 2023 11:45:05 +0200 Subject: [PATCH] chore(otellogs): move adding imagePullSecrets to ServiceAccount --- .changelog/2984.fixed.txt | 2 +- .../templates/logs/collector/otelcol/daemonset.yaml | 4 ---- .../logs/collector/otelcol/serviceaccount.yaml | 4 ++++ .../goldenfile/logs_otc_daemonset/complex.input.yaml | 2 -- .../logs_otc_daemonset/complex.output.yaml | 2 -- .../logs_otc_serviceaccount/basic.input.yaml | 0 .../logs_otc_serviceaccount/basic.output.yaml | 10 ++++++++++ .../image_pull_secrets.input.yaml | 3 +++ .../image_pull_secrets.output.yaml | 12 ++++++++++++ 9 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 tests/helm/testdata/goldenfile/logs_otc_serviceaccount/basic.input.yaml create mode 100644 tests/helm/testdata/goldenfile/logs_otc_serviceaccount/basic.output.yaml create mode 100644 tests/helm/testdata/goldenfile/logs_otc_serviceaccount/image_pull_secrets.input.yaml create mode 100644 tests/helm/testdata/goldenfile/logs_otc_serviceaccount/image_pull_secrets.output.yaml diff --git a/.changelog/2984.fixed.txt b/.changelog/2984.fixed.txt index a8ae8515b8..27a8760cad 100644 --- a/.changelog/2984.fixed.txt +++ b/.changelog/2984.fixed.txt @@ -1 +1 @@ -fix(otellogs): configure imagePullSecrets for otellogs daemonset \ No newline at end of file +fix(otellogs): configure imagePullSecrets for otellogs \ No newline at end of file diff --git a/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml b/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml index ae44c830dc..aa382ccdd5 100644 --- a/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml +++ b/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml @@ -67,10 +67,6 @@ spec: {{- else }} priorityClassName: {{ include "sumologic.metadata.name.priorityclass" $ctx | quote }} {{- end }} -{{- if $.Values.sumologic.pullSecrets }} - imagePullSecrets: -{{ toYaml $.Values.sumologic.pullSecrets | indent 8 }} -{{- end }} containers: - args: - --config=/etc/otelcol/config.yaml diff --git a/deploy/helm/sumologic/templates/logs/collector/otelcol/serviceaccount.yaml b/deploy/helm/sumologic/templates/logs/collector/otelcol/serviceaccount.yaml index f33a6adbd9..fdb27769af 100644 --- a/deploy/helm/sumologic/templates/logs/collector/otelcol/serviceaccount.yaml +++ b/deploy/helm/sumologic/templates/logs/collector/otelcol/serviceaccount.yaml @@ -7,3 +7,7 @@ metadata: app: {{ template "sumologic.labels.app.logs.collector.serviceaccount" . }} {{- include "sumologic.labels.common" . | nindent 4 }} {{- end }} +{{- if .Values.sumologic.pullSecrets }} +imagePullSecrets: +{{ toYaml .Values.sumologic.pullSecrets | indent 2 }} +{{- end }} diff --git a/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.input.yaml b/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.input.yaml index 4dbad4daca..4809eac513 100644 --- a/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.input.yaml +++ b/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.input.yaml @@ -3,8 +3,6 @@ sumologic: collector: otelcol: enabled: true - pullSecrets: - - name: myRegistryKeySecretName fluent-bit: enabled: false diff --git a/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.output.yaml b/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.output.yaml index 7c9349ee18..1df9bd47b0 100644 --- a/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.output.yaml +++ b/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.output.yaml @@ -41,8 +41,6 @@ spec: runAsGroup: 0 runAsUser: 0 priorityClassName: "prio" - imagePullSecrets: - - name: myRegistryKeySecretName containers: - args: - --config=/etc/otelcol/config.yaml diff --git a/tests/helm/testdata/goldenfile/logs_otc_serviceaccount/basic.input.yaml b/tests/helm/testdata/goldenfile/logs_otc_serviceaccount/basic.input.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/helm/testdata/goldenfile/logs_otc_serviceaccount/basic.output.yaml b/tests/helm/testdata/goldenfile/logs_otc_serviceaccount/basic.output.yaml new file mode 100644 index 0000000000..460d566aad --- /dev/null +++ b/tests/helm/testdata/goldenfile/logs_otc_serviceaccount/basic.output.yaml @@ -0,0 +1,10 @@ +# Source: sumologic/templates/logs/collector/otelcol/serviceaccount.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: RELEASE-NAME-sumologic-otelcol-logs-collector + labels: + app: RELEASE-NAME-sumologic-otelcol-logs-collector + chart: "sumologic-%CURRENT_CHART_VERSION%" + release: "RELEASE-NAME" + heritage: "Helm" diff --git a/tests/helm/testdata/goldenfile/logs_otc_serviceaccount/image_pull_secrets.input.yaml b/tests/helm/testdata/goldenfile/logs_otc_serviceaccount/image_pull_secrets.input.yaml new file mode 100644 index 0000000000..3123b61b19 --- /dev/null +++ b/tests/helm/testdata/goldenfile/logs_otc_serviceaccount/image_pull_secrets.input.yaml @@ -0,0 +1,3 @@ +sumologic: + pullSecrets: + - name: myRegistryKeySecretName diff --git a/tests/helm/testdata/goldenfile/logs_otc_serviceaccount/image_pull_secrets.output.yaml b/tests/helm/testdata/goldenfile/logs_otc_serviceaccount/image_pull_secrets.output.yaml new file mode 100644 index 0000000000..7139ed8ab0 --- /dev/null +++ b/tests/helm/testdata/goldenfile/logs_otc_serviceaccount/image_pull_secrets.output.yaml @@ -0,0 +1,12 @@ +# Source: sumologic/templates/logs/collector/otelcol/serviceaccount.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: RELEASE-NAME-sumologic-otelcol-logs-collector + labels: + app: RELEASE-NAME-sumologic-otelcol-logs-collector + chart: "sumologic-%CURRENT_CHART_VERSION%" + release: "RELEASE-NAME" + heritage: "Helm" +imagePullSecrets: + - name: myRegistryKeySecretName