-
Notifications
You must be signed in to change notification settings - Fork 237
Expand file tree
/
Copy path_helpers.tpl
More file actions
93 lines (84 loc) · 2.56 KB
/
_helpers.tpl
File metadata and controls
93 lines (84 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{{/*
Expand the name of the chart.
*/}}
{{- define "josdk-operator.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
*/}}
{{- define "josdk-operator.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Chart label.
*/}}
{{- define "josdk-operator.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels applied to every resource.
*/}}
{{- define "josdk-operator.labels" -}}
helm.sh/chart: {{ include "josdk-operator.chart" . }}
{{ include "josdk-operator.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels used in Deployment and Service selectors.
*/}}
{{- define "josdk-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "josdk-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
ServiceAccount name.
*/}}
{{- define "josdk-operator.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "josdk-operator.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{/*
Deployment namespace.
*/}}
{{- define "josdk-operator.namespace" -}}
{{- default .Release.Namespace .Values.namespace }}
{{- end }}
{{/*
Name of the JOSDK config ConfigMap.
*/}}
{{- define "josdk-operator.configMapName" -}}
{{- default (printf "%s-config" (include "josdk-operator.fullname" .)) .Values.josdkConfig.configMapName }}
{{- end }}
{{/*
Name of the log4j2 ConfigMap.
*/}}
{{- define "josdk-operator.log4j2ConfigMapName" -}}
{{- default (printf "%s-log4j2" (include "josdk-operator.fullname" .)) .Values.log4j2.configMapName }}
{{- end }}
{{/*
JAVA_TOOL_OPTIONS / JVM args value.
Appends the log4j2 config file system property automatically when log4j2 is enabled.
*/}}
{{- define "josdk-operator.jvmArgs" -}}
{{- $args := .Values.jvmArgs | default "" }}
{{- if .Values.log4j2.enabled }}
{{- $args = printf "%s -Dlog4j2.configurationFile=%s/log4j2.xml" $args .Values.log4j2.mountPath | trim }}
{{- end }}
{{- $args }}
{{- end }}