Skip to content

Commit

Permalink
Refactor: Extract vaas-helm.sentryEnvironmentVariables helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Stadermann committed Aug 28, 2024
1 parent 733221e commit ca5b5fe
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-helm.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-helm.sentryEnvironmentVariables" . | nindent 12 }}
- name: MaxAnalysisDuration
value: {{ include "common.secondsToHHMMSS" .Values.gateway.terminationGracePeriodSeconds | quote }}
- name: FileCloudVerdictSource__Enable
Expand Down

0 comments on commit ca5b5fe

Please sign in to comment.