From 7bdb8763377a45d03f5dcc234068465c7ad8149d Mon Sep 17 00:00:00 2001 From: Angelos Mimidis Date: Wed, 6 Apr 2022 13:12:08 +0200 Subject: [PATCH] Check if selectors,tolerations and labels are defined before adding field --- cluster-agent/templates/cluster-agent.yaml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/cluster-agent/templates/cluster-agent.yaml b/cluster-agent/templates/cluster-agent.yaml index 6fea796..3532e00 100644 --- a/cluster-agent/templates/cluster-agent.yaml +++ b/cluster-agent/templates/cluster-agent.yaml @@ -72,22 +72,25 @@ spec: # Pod filter properties podFilter: {{- toYaml .Values.podFilter | nindent 4 }} - + {{ if .Values.agentPod.nodeSelector }} # Node selector nodeSelector: {{- toYaml .Values.agentPod.nodeSelector | nindent 4 }} - + {{- end }} + {{ if .Values.agentPod.tolerations }} # Tolerations tolerations: {{- toYaml .Values.agentPod.tolerations | nindent 4 }} - + {{- end }} + {{ if .Values.agentPod.labels }} labels: {{- toYaml .Values.agentPod.labels | nindent 4 }} - + {{- end }} + {{ if .Values.agentPod.resources }} # Resources resources: {{- toYaml .Values.agentPod.resources | nindent 4 }} - + {{- end }} {{ with .Values.instrumentationConfig -}} {{ if .enabled -}} # Instrumentation config @@ -155,4 +158,4 @@ spec: {{- end }} {{ end -}} {{ end -}} -{{ end -}} \ No newline at end of file +{{ end -}}