Skip to content

Commit 3bfd047

Browse files
maorhalevi-sonatishauli
authored andcommitted
charts: templates: _helpers: create helper uuid and config map envs only if communicator enabled
1 parent 0e0efb6 commit 3bfd047

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

charts/s1-agent/templates/_helpers.tpl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,10 @@ requests:
453453
{{- end -}}
454454

455455
{{- define "helper.config" -}}
456+
{{- $helperConfig := dict }}
457+
{{- $_ := set $helperConfig "S1_HELPER_LOG_SIZE" (.Values.configuration.env.helper.log_size | toString) -}}
458+
{{- $_ := set $helperConfig "S1_COMMUNICATOR_ENABLED" (printf "%t" .Values.configuration.env.helper.communicator_enabled) -}}
459+
{{- if .Values.configuration.env.helper.communicator_enabled -}}
456460
{{- $persistent_uuid := "" -}}
457461
{{- $uuid := uuidv4 -}}
458462
{{- $configmap := (lookup "v1" "ConfigMap" .Release.Namespace (include "helper.config.name" .)) }}
@@ -462,12 +466,9 @@ requests:
462466
{{- if $persistent_uuid }}
463467
{{- $uuid = $persistent_uuid -}}
464468
{{- end }}
465-
{{- $helperConfig := dict "S1_HELPER_UUID" $uuid -}}
469+
{{- $_ := set $helperConfig "S1_HELPER_UUID" $uuid -}}
466470
{{- $_ := set $helperConfig "S1_INVENTORY_ENABLED" (printf "%t" .Values.configuration.env.helper.inventory_enabled) -}}
467471
{{- $_ := set $helperConfig "S1_INVENTORY_ONLY" (printf "%t" .Values.configuration.inventory_only) -}}
468-
{{- $_ := set $helperConfig "S1_HELPER_LOG_SIZE" (.Values.configuration.env.helper.log_size | toString) -}}
469-
{{- $_ := set $helperConfig "COMMUNICATOR_ENABLED" (printf "%t" .Values.configuration.env.helper.communicator_enabled) -}}
470-
{{- if .Values.configuration.env.helper.communicator_enabled -}}
471472
{{- $_ := set $helperConfig "S1_MANAGEMENT_PROXY" (default "" .Values.configuration.proxy) -}}
472473
{{- end -}}
473474
{{- if .Values.configuration.env.injection.enabled -}}

0 commit comments

Comments
 (0)