Skip to content

Commit

Permalink
feat(agent): add "sysdig_api_endpoint" in dragent.yaml based on the r…
Browse files Browse the repository at this point in the history
…egion (#2072)
  • Loading branch information
legobrick authored Jan 21, 2025
1 parent 0baf206 commit a3b4239
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 49 deletions.
2 changes: 1 addition & 1 deletion charts/agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ sources:
- https://app.sysdigcloud.com/#/settings/user
- https://github.com/draios/sysdig
type: application
version: 1.34.8
version: 1.35.0
13 changes: 13 additions & 0 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,6 +535,10 @@ 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 }}
{{- $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
Loading

0 comments on commit a3b4239

Please sign in to comment.