Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions helm/robusta/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,34 @@ active_playbooks:

{{- end }}
{{ end }}

{{/*
Determine if this is a Robusta SaaS environment.
Returns "true" if ROBUSTA_UI_DOMAIN is not set OR ends with ".robusta.dev"
*/}}
{{- define "robusta.isSaasEnvironment" -}}
{{- $robustaUiDomain := "" -}}
{{- range .Values.runner.additional_env_vars -}}
{{- if eq .name "ROBUSTA_UI_DOMAIN" -}}
{{- $robustaUiDomain = .value -}}
{{- end -}}
{{- end -}}
{{- if or (eq $robustaUiDomain "") (hasSuffix ".robusta.dev" $robustaUiDomain) -}}
true
{{- else -}}
false
{{- end -}}
{{- end -}}

{{/*
Determine the Sentry DSN value.
Returns the user-provided value if set, otherwise returns the default SaaS DSN if in a SaaS environment, otherwise returns empty string.
*/}}
{{- define "robusta.sentryDsn" -}}
{{- if .Values.runner.sentry_dsn -}}
{{ .Values.runner.sentry_dsn }}
{{- else if eq (include "robusta.isSaasEnvironment" .) "true" -}}
https://18ac614b2d7fbbb3c7a7789b946506e1@o4510692373299200.ingest.de.sentry.io/4510707940982864
{{- else -}}
{{- end -}}
{{- end -}}
8 changes: 5 additions & 3 deletions helm/robusta/templates/runner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ spec:
targetLabels:
- target
{{ end }}
{{ if .Values.runner.sentry_dsn }}
{{- $sentryDsn := include "robusta.sentryDsn" . -}}
{{- if $sentryDsn }}
---
apiVersion: v1
kind: Secret
Expand All @@ -327,5 +328,6 @@ metadata:
namespace: {{ .Release.Namespace }}
type: Opaque
stringData:
SENTRY_DSN: {{ .Values.runner.sentry_dsn }}
{{ end }}
SENTRY_DSN: {{ $sentryDsn }}
{{- end }}

2 changes: 1 addition & 1 deletion helm/robusta/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ runner:
imagePullPolicy: IfNotPresent
revisionHistoryLimit: 10
log_level: INFO
sentry_dsn: https://[email protected]/6156573
sentry_dsn: ""
sendAdditionalTelemetry: false
certificate: "" # base64 encoded
createServiceAccount: true
Expand Down
Loading