Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
legobrick authored and mavimo committed Jan 2, 2025
1 parent f48fb07 commit 0650471
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions charts/agent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/}}
Expand Down Expand Up @@ -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 }}

Expand Down

0 comments on commit 0650471

Please sign in to comment.