-
Notifications
You must be signed in to change notification settings - Fork 0
/
_helpers.tpl
47 lines (41 loc) · 1.09 KB
/
_helpers.tpl
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
{{/*
Default
*/}}
{{- define "accessModes.template" -}}
{{- if eq .Values.default.accessModes "RWO" -}}
{{- print "ReadWriteOnce" }}
{{- else if eq .Values.default.accessModes "RWX" -}}
{{- print "ReadWriteMany" }}
{{- end }}
{{- end -}}
{{/*
General
*/}}
{{- define "kubeVersion" }}
{{- default .Capabilities.KubeVersion.Version (regexFind "v[0-9]+\\.[0-9]+\\.[0-9]+" .Capabilities.KubeVersion.Version) -}}
{{- end }}
{{- define "cluster.syncPolicy.default" }}
syncPolicy:
syncOptions:
- CreateNamespace=true
{{- if .Values.sync.enabled }}
automated:
prune: {{ .Values.sync.prune }}
selfHeal: {{ .Values.sync.selfHeal }}
{{- end }}
{{- end }}
{{- define "cluster.syncPolicy.withoutNamespace" }}
syncPolicy:
syncOptions:
- CreateNamespace=false
{{- if .Values.sync.enabled }}
automated:
prune: {{ .Values.sync.prune }}
selfHeal: {{ .Values.sync.selfHeal }}
{{- end }}
{{- end }}
{{- define "argocd.applications.finalizers" }}
{{- if .Values.sync.prune }}
{{- print "- resources-finalizer.argocd.argoproj.io" }}
{{- end }}
{{- end }}