From 06504719652f9d0bb8e7b8d580f2a843c32b5f4d Mon Sep 17 00:00:00 2001 From: Paolo Polidori Date: Wed, 11 Dec 2024 18:11:40 +0100 Subject: [PATCH] fix --- charts/agent/templates/_helpers.tpl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/charts/agent/templates/_helpers.tpl b/charts/agent/templates/_helpers.tpl index 65ed9d89e..d57ccbcb7 100644 --- a/charts/agent/templates/_helpers.tpl +++ b/charts/agent/templates/_helpers.tpl @@ -358,6 +358,15 @@ Determine sysdig secure endpoint based on provided region {{- end -}} {{- end -}} +{{/* +Determine api endpoint based on provided region +*/}} +{{- define "agent.secureApiEndpoint" -}} + {{- if hasKey ((include "sysdig.regions" .) | fromYaml) .Values.global.sysdig.region }} + {{- include "sysdig.secureApiEndpoint" . }} + {{- end -}} +{{- end -}} + {{/* Agent agentConfigmapName */}} @@ -526,10 +535,9 @@ ssl_verify_certificate: {{ $sslVerifyCertificate }} {{- if eq (include "sysdig.custom_ca.enabled" (dict "global" .Values.global.ssl "component" .Values.ssl)) "true" }} ca_certificate: certificates/{{ include "sysdig.custom_ca.keyName" (dict "global" .Values.global.ssl "component" .Values.ssl) }} {{- end }} - -{{- $sysdigApiEndpoint := include "sysdig.secureApiEndpoint" . }} -{{- if $sysdigApiEndpoint }} -sysdig_api_endpoint: {{ $sysdigApiEndpoint }} +{{- $secureApiEndpoint := include "get_if_not_in_settings" (dict "root" . "default" (include "sysdig.secureApiEndpoint" .) "setting" "sysdig_api_endpoint") }} +{{- if $secureApiEndpoint }} +sysdig_api_endpoint: {{ $secureApiEndpoint }} {{- end }} {{- end }}