1 {{/* vim: set filetype=mustache: */}}
3 Expand the name of the chart.
5 {{- define "oauth2-proxy.name" -}}
6 {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
10 Create a default fully qualified app name.
11 We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12 If release name contains chart name it will be used as a full name.
14 {{- define "oauth2-proxy.fullname" -}}
15 {{- if .Values.fullnameOverride -}}
16 {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
18 {{- $name := default .Chart.Name .Values.nameOverride -}}
19 {{- if contains $name .Release.Name -}}
20 {{- .Release.Name | trunc 63 | trimSuffix "-" -}}
22 {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
28 Create chart name and version as used by the chart label.
30 {{- define "oauth2-proxy.chart" -}}
31 {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
37 {{- define "oauth2-proxy.labels" }}
38 helm.sh/chart: {{ include "oauth2-proxy.chart" . }}
39 app.kubernetes.io/managed-by: {{ .Release.Service }}
40 app.kubernetes.io/component: authentication-proxy
41 app.kubernetes.io/part-of: {{ template "oauth2-proxy.name" . }}
42 {{- include "oauth2-proxy.selectorLabels" . }}
43 {{- if .Chart.AppVersion }}
44 app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
46 {{- if .Values.customLabels }}
47 {{ toYaml .Values.customLabels }}
54 {{- define "oauth2-proxy.selectorLabels" }}
55 app.kubernetes.io/name: {{ include "oauth2-proxy.name" . }}
56 app.kubernetes.io/instance: {{ .Release.Name }}
62 {{- define "oauth2-proxy.secretName" -}}
63 {{- if .Values.config.existingSecret -}}
64 {{- printf "%s" .Values.config.existingSecret -}}
66 {{- printf "%s" (include "oauth2-proxy.fullname" .) -}}
71 Create the name of the service account to use
73 {{- define "oauth2-proxy.serviceAccountName" -}}
74 {{- if .Values.serviceAccount.enabled -}}
75 {{ default (include "oauth2-proxy.fullname" .) .Values.serviceAccount.name }}
77 {{ default "default" .Values.serviceAccount.name }}
82 Redis subcharts fullname
84 {{- define "oauth2-proxy.redis.fullname" -}}
85 {{- if .Values.redis.enabled -}}
86 {{- include "common.names.fullname" (dict "Chart" (dict "Name" "redis") "Release" .Release "Values" .Values.redis) -}}
88 {{ fail "attempting to use redis subcharts fullname, even though the subchart is not enabled. This will lead to misconfiguration" }}
93 Compute the redis url if not set explicitly.
95 {{- define "oauth2-proxy.redis.StandaloneUrl" -}}
96 {{- if .Values.sessionStorage.redis.standalone.connectionUrl -}}
97 {{ .Values.sessionStorage.redis.standalone.connectionUrl }}
98 {{- else if .Values.redis.enabled -}}
99 {{- printf "redis://%s-master:%.0f" (include "oauth2-proxy.redis.fullname" .) .Values.redis.master.service.ports.redis -}}
101 {{ fail "please set sessionStorage.redis.standalone.connectionUrl or enable the redis subchart via redis.enabled" }}
108 {{- define "oauth2-proxy.version" -}}
109 {{ trimPrefix "v" (lower (.Values.image.tag | default (printf "v%s" .Chart.AppVersion))) }}