Skip to content

Commit

Permalink
Refactor: Extract vaas-helm.sentryEnvironmentVariables helper (#71)
Browse files Browse the repository at this point in the history
Co-authored-by: Philip Stadermann <[email protected]>
  • Loading branch information
pstadermann and Philip Stadermann authored Aug 30, 2024
1 parent b824ac4 commit 874a67f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 30 deletions.
32 changes: 32 additions & 0 deletions charts/vaas/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- define "vaas.sentryEnvironmentVariables" }}
{{- if .Values.sentry }}
{{- if .Values.sentry.environment }}
- name: Sentry__Environment
value: {{ .Values.sentry.environment | quote }}
{{- end }}
{{- if .Values.sentry.dsn }}
- name: Sentry__Dsn
value: {{ .Values.sentry.dsn | quote }}
{{- end }}
{{- if .Values.sentry.release }}
- name: Sentry__Release
value: {{ .Values.sentry.release | quote }}
{{- end }}
{{- if .Values.sentry.maxBreadcrumbs }}
- name: Sentry__MaxBreadcrumbs
value: {{ .Values.sentry.maxBreadcrumbs | quote }}
{{- end }}
{{- if .Values.sentry.maxQueueItems }}
- name: Sentry__MaxQueueItems
value: {{ .Values.sentry.maxQueueItems | quote }}
{{- end }}
{{- if .Values.sentry.enableTracing }}
- name: Sentry__EnableTracing
value: {{ .Values.sentry.enableTracing | quote }}
{{- end }}
{{- if .Values.sentry.tracesSampleRate }}
- name: Sentry__TracesSampleRate
value: {{ .Values.sentry.tracesSampleRate | quote }}
{{- end }}
{{- end }}
{{- end }}
31 changes: 1 addition & 30 deletions charts/vaas/templates/gateway/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,36 +59,7 @@ spec:
value: {{ .Release.Name }}
- name: ASPNETCORE_ENVIRONMENT
value: {{ .Release.Name }}
{{- if .Values.sentry }}
{{- if .Values.sentry.environment }}
- name: Sentry__Environment
value: {{ .Values.sentry.environment | quote }}
{{- end }}
{{- if .Values.sentry.dsn }}
- name: Sentry__Dsn
value: {{ .Values.sentry.dsn | quote }}
{{- end }}
{{- if .Values.sentry.release }}
- name: Sentry__Release
value: {{ .Values.sentry.release | quote }}
{{- end }}
{{- if .Values.sentry.maxBreadcrumbs }}
- name: Sentry__MaxBreadcrumbs
value: {{ .Values.sentry.maxBreadcrumbs | quote }}
{{- end }}
{{- if .Values.sentry.maxQueueItems }}
- name: Sentry__MaxQueueItems
value: {{ .Values.sentry.maxQueueItems | quote }}
{{- end }}
{{- if .Values.sentry.enableTracing }}
- name: Sentry__EnableTracing
value: {{ .Values.sentry.enableTracing | quote }}
{{- end }}
{{- if .Values.sentry.tracesSampleRate }}
- name: Sentry__TracesSampleRate
value: {{ .Values.sentry.tracesSampleRate | quote }}
{{- end }}
{{- end }}
{{- include "vaas.sentryEnvironmentVariables" . | nindent 12 }}
- name: MaxAnalysisDuration
value: {{ include "common.secondsToHHMMSS" .Values.gateway.terminationGracePeriodSeconds | quote }}
- name: FileCloudVerdictSource__Enable
Expand Down

0 comments on commit 874a67f

Please sign in to comment.