Skip to content

Commit a2460b9

Browse files
Ani1357CasLubbers
andauthored
fix: apl helm chart helpers(#1734)
Co-authored-by: CasLubbers <[email protected]>
1 parent 5145a05 commit a2460b9

File tree

7 files changed

+25
-25
lines changed

7 files changed

+25
-25
lines changed

chart/apl/templates/_helpers.tpl

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{/*
22
Expand the name of the chart.
33
*/}}
4-
{{- define "otomi.name" -}}
4+
{{- define "apl.name" -}}
55
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
66
{{- end }}
77

@@ -10,7 +10,7 @@ Create a default fully qualified app name.
1010
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
1111
If release name contains chart name it will be used as a full name.
1212
*/}}
13-
{{- define "otomi.fullname" -}}
13+
{{- define "apl.fullname" -}}
1414
{{- if .Values.fullnameOverride }}
1515
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
1616
{{- else }}
@@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
2626
{{/*
2727
Create chart name and version as used by the chart label.
2828
*/}}
29-
{{- define "otomi.chart" -}}
29+
{{- define "apl.chart" -}}
3030
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
3131
{{- end }}
3232

3333
{{/*
3434
Common labels
3535
*/}}
36-
{{- define "otomi.labels" -}}
37-
helm.sh/chart: {{ include "otomi.chart" . }}
38-
{{ include "otomi.selectorLabels" . }}
36+
{{- define "apl.labels" -}}
37+
helm.sh/chart: {{ include "apl.chart" . }}
38+
{{ include "apl.selectorLabels" . }}
3939
{{- if .Chart.AppVersion }}
4040
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
4141
{{- end }}
@@ -45,8 +45,8 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
4545
{{/*
4646
Selector labels
4747
*/}}
48-
{{- define "otomi.selectorLabels" -}}
49-
app.kubernetes.io/name: {{ include "otomi.name" . }}
48+
{{- define "apl.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "apl.name" . }}
5050
app.kubernetes.io/instance: {{ .Release.Name }}
5151
{{- end }}
5252

chart/apl/templates/job.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
apiVersion: batch/v1
55
kind: Job
66
metadata:
7-
name: {{ include "otomi.fullname" . }}
8-
labels: {{- include "otomi.labels" . | nindent 4 }}
7+
name: {{ include "apl.fullname" . }}
8+
labels: {{- include "apl.labels" . | nindent 4 }}
99
spec:
1010
backoffLimit: 2
1111
template:
1212
metadata:
1313
{{- with .Values.podAnnotations }}
1414
annotations: {{- toYaml . | nindent 8 }}
1515
{{- end }}
16-
labels: {{- include "otomi.selectorLabels" . | nindent 8 }}
16+
labels: {{- include "apl.selectorLabels" . | nindent 8 }}
1717
spec:
1818
dnsConfig:
1919
nameservers:
2020
- 8.8.8.8
2121
- 8.8.4.4
2222
restartPolicy: Never
23-
serviceAccountName: {{ include "otomi.fullname" . }}
23+
serviceAccountName: {{ include "apl.fullname" . }}
2424
securityContext:
2525
runAsNonRoot: true
2626
runAsUser: 999
@@ -58,7 +58,7 @@ spec:
5858
{{- if hasKey $kms "sops" }}
5959
envFrom:
6060
- secretRef:
61-
name: {{ include "otomi.fullname" . }}-sops-secrets
61+
name: {{ include "apl.fullname" . }}-sops-secrets
6262
{{- end }}
6363
volumeMounts:
6464
- name: otomi-values

chart/apl/templates/post-job.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
apiVersion: batch/v1
44
kind: Job
55
metadata:
6-
name: {{ include "otomi.fullname" . }}-pre-delete-job
6+
name: {{ include "apl.fullname" . }}-pre-delete-job
77
annotations:
88
helm.sh/hook: pre-delete
99
helm.sh/hook-delete-policy: hook-succeeded
10-
labels: {{- include "otomi.labels" . | nindent 4 }}
10+
labels: {{- include "apl.labels" . | nindent 4 }}
1111
spec:
1212
backoffLimit: 2
1313
ttlSecondsAfterFinished: 100
@@ -16,10 +16,10 @@ spec:
1616
{{- with .Values.podAnnotations }}
1717
annotations: {{- toYaml . | nindent 8 }}
1818
{{- end }}
19-
labels: {{- include "otomi.selectorLabels" . | nindent 8 }}
19+
labels: {{- include "apl.selectorLabels" . | nindent 8 }}
2020
spec:
2121
restartPolicy: Never
22-
serviceAccountName: {{ include "otomi.fullname" . }}
22+
serviceAccountName: {{ include "apl.fullname" . }}
2323
securityContext:
2424
runAsNonRoot: true
2525
runAsUser: 999
@@ -58,7 +58,7 @@ spec:
5858
{{- if hasKey $kms "sops" }}
5959
envFrom:
6060
- secretRef:
61-
name: {{ include "otomi.fullname" . }}-sops-secrets
61+
name: {{ include "apl.fullname" . }}-sops-secrets
6262
{{- end }}
6363
volumeMounts:
6464
- name: otomi-values

chart/apl/templates/rbac.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRoleBinding
33
metadata:
4-
name: {{ include "otomi.fullname" . }}
5-
labels: {{- include "otomi.selectorLabels" . | nindent 8 }}
4+
name: {{ include "apl.fullname" . }}
5+
labels: {{- include "apl.selectorLabels" . | nindent 8 }}
66
roleRef:
77
apiGroup: rbac.authorization.k8s.io
88
kind: ClusterRole
99
name: cluster-admin
1010
subjects:
1111
- kind: ServiceAccount
12-
name: {{ include "otomi.fullname" . }}
12+
name: {{ include "apl.fullname" . }}
1313
namespace: {{ .Release.Namespace }}
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v1
22
kind: ServiceAccount
33
metadata:
4-
name: {{ include "otomi.fullname" . }}
5-
labels: {{- include "otomi.labels" . | nindent 4 }}
4+
name: {{ include "apl.fullname" . }}
5+
labels: {{- include "apl.labels" . | nindent 4 }}
66
{{- with .Values.serviceAccountAnnotations }}
77
annotations: {{- toYaml . | nindent 4 }}
88
{{- end }}

chart/apl/templates/sops-secrets.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
apiVersion: v1
55
kind: Secret
66
metadata:
7-
name: {{ include "otomi.fullname" . }}-sops-secrets
7+
name: {{ include "apl.fullname" . }}-sops-secrets
88
type: Opaque
99
data:
1010
{{- with $v.azure }}

chart/apl/templates/values-secrets.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ apiVersion: v1
88
kind: Secret
99
metadata:
1010
name: {{ .Release.Name }}-values
11-
labels: {{- include "otomi.labels" . | nindent 4 }}
11+
labels: {{- include "apl.labels" . | nindent 4 }}
1212
type: Opaque
1313
data:
1414
values.yaml: |-

0 commit comments

Comments
 (0)