From 60bc5e412e01f457c7a7517682857c7f212c4024 Mon Sep 17 00:00:00 2001 From: Adam Boguszewski Date: Mon, 5 Feb 2024 09:45:38 +0100 Subject: [PATCH] fix(logs): fix global tolerations for otellogs daemonset --- .changelog/3523.fixed.txt | 1 + deploy/helm/sumologic/templates/_helpers/_logs.tpl | 8 ++++++++ .../templates/logs/collector/otelcol/daemonset.yaml | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changelog/3523.fixed.txt diff --git a/.changelog/3523.fixed.txt b/.changelog/3523.fixed.txt new file mode 100644 index 0000000000..889d3a81ca --- /dev/null +++ b/.changelog/3523.fixed.txt @@ -0,0 +1 @@ +fix(logs): fix global tolerations for otellogs daemonset \ No newline at end of file diff --git a/deploy/helm/sumologic/templates/_helpers/_logs.tpl b/deploy/helm/sumologic/templates/_helpers/_logs.tpl index 9d61400ba2..3250b70d92 100644 --- a/deploy/helm/sumologic/templates/_helpers/_logs.tpl +++ b/deploy/helm/sumologic/templates/_helpers/_logs.tpl @@ -320,6 +320,14 @@ Return the otelcol log collector image {{ template "utils.getOtelImage" (dict "overrideImage" .Values.otellogs.image "defaultImage" .Values.sumologic.otelcolImage) }} {{- end -}} +{{- define "sumologic.logs.collector.tolerations" -}} +{{- if .Values.otellogs.daemonset.tolerations -}} +{{- toYaml .Values.otellogs.daemonset.tolerations -}} +{{- else -}} +{{- template "kubernetes.defaultTolerations" . -}} +{{- end -}} +{{- end -}} + {{/* Check if autoscaling for metadata logs is enabled. diff --git a/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml b/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml index 0a58cdf53b..138b61f315 100644 --- a/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml +++ b/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml @@ -2,7 +2,7 @@ {{- $ctx := . }} {{- $instance := "" -}} {{- $defaultNodeSelector := (include "kubernetes.defaultNodeSelector" .) }} -{{- $defaultTolerations := (include "kubernetes.defaultTolerations" .) }} +{{- $defaultTolerations := (include "sumologic.logs.collector.tolerations" .) }} {{- $defaultAffinity := (include "kubernetes.defaultAffinity" .) }} {{- $daemonsets := dict "" $.Values.otellogs.daemonset -}} {{- $daemonsets = deepCopy $daemonsets | merge $.Values.otellogs.additionalDaemonSets -}}