Skip to content

Commit

Permalink
Add in Common CORS and OTLP Config
Browse files Browse the repository at this point in the history
  • Loading branch information
spjmurray committed Jun 18, 2024
1 parent 2eed5c3 commit a64eb82
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/unikorn-common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ description: Unikorn common templates to keep dependent charts in check.

type: application

version: v0.1.0
version: v0.1.1

icon: https://raw.githubusercontent.com/unikorn-cloud/assets/main/images/logos/dark-on-light/icon.png
29 changes: 29 additions & 0 deletions charts/unikorn-common/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,35 @@ prometheus.unikorn-cloud.org/job
{{ include "unikorn.prometheusJobLabel" . }}: {{ .job }}
{{- end }}

{{/*
OTLP support.
Used to configure tracing across all components.
*/}}
{{- define "unikorn.otlp.endpoint" -}}
{{- if ( and .Values.global .Values.global.otlp .Values.global.otlp.endpoint ) -}}
{{- .Values.global.otlp.endpoint }}
{{- else if ( and .Values.otlp .Values.otlp.endpoint) -}}
{{- .Values.otlp.endpoint }}
{{- end }}
{{- end }}

{{/*
CORS support.
Used to lock down APIs to specific clients.
*/}}
{{- define "unikorn.cors" -}}
{{- $cors := .Values.cors -}}
{{- if ( and .Values.global .Values.global.cors ) -}}
{{- $cors = .Values.global.cors -}}
{{- end }}
{{- range $origin := $cors.allowOrigin }}
- --cors-allow-origin={{ $origin }}
{{- end }}
{{- if $cors.maxAge }}
- --cors-max-age={{ $cors.maxAge }}
{{- end }}
{{- end }}

{{/*
Creates predicatable Kubernetes name compatible UUIDs from name.
Note we always start with a letter (kubernetes DNS label requirement),
Expand Down

0 comments on commit a64eb82

Please sign in to comment.