Skip to content

Commit

Permalink
Use sysdig.apiEndpoint to compute the NATS Url
Browse files Browse the repository at this point in the history
  • Loading branch information
airadier committed Jul 3, 2023
1 parent 1c9f5ba commit 2963ce5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions charts/admission-controller/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,17 @@ Determine Secure endpoint based on provided region or .Values.sysdig.apiEndpoint
{{- end -}}
{{- end -}}

{{/*
Sysdig NATS service URL
*/}}
{{- define "admissionController.natsUrl" -}}
{{- if .Values.webhook.v2.nats.url -}}
{{- .Values.webhook.v2.nats.url -}}
{{- else -}}
wss://{{ include "admissionController.apiEndpoint" . }}:443
{{- end -}}
{{- end -}}


{{/*
Common labels
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ data:
{{- if .Values.features.kspmAdmissionController}}
SERVICE_PORT: "{{.Values.webhook.v2.container.port}}"
CERT_LOCATION: /cert
EXTERNAL_NATS_URL: "wss://{{required "Nats URL is missing" .Values.webhook.v2.nats.url }}:443"
EXTERNAL_NATS_URL: {{ include "admissionController.natsUrl" . }}
NATS_INSECURE: "{{.Values.webhook.v2.nats.insecure}}"
{{- end}}

0 comments on commit 2963ce5

Please sign in to comment.