Skip to content

Commit

Permalink
Ensure we use global for includes. (#568)
Browse files Browse the repository at this point in the history
Some call sites used . which was sometimes not the global context.
  • Loading branch information
robholland authored Oct 1, 2024
1 parent 95b67a7 commit 4c3a155
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 37 deletions.
14 changes: 7 additions & 7 deletions charts/temporal/templates/admintools-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "temporal.componentname" (list . "admintools") }}
name: {{ include "temporal.componentname" (list $ "admintools") }}
labels:
{{- include "temporal.resourceLabels" (list . "admintools" "") | nindent 4 }}
{{- include "temporal.resourceLabels" (list $ "admintools" "") | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: {{ include "temporal.name" . }}
app.kubernetes.io/name: {{ include "temporal.name" $ }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: admintools
template:
metadata:
labels:
{{- include "temporal.resourceLabels" (list . "admintools" "pod") | nindent 8 }}
{{- include "temporal.resourceLabels" (list $ "admintools" "pod") | nindent 8 }}
{{- with $.Values.admintools.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{ include "temporal.serviceAccount" . }}
{{ include "temporal.serviceAccount" $ }}
containers:
- name: admin-tools
image: "{{ .Values.admintools.image.repository }}:{{ .Values.admintools.image.tag }}"
Expand All @@ -33,9 +33,9 @@ spec:
env:
# TEMPORAL_CLI_ADDRESS is deprecated, use TEMPORAL_ADDRESS instead
- name: TEMPORAL_CLI_ADDRESS
value: {{ include "temporal.fullname" . }}-frontend:{{ .Values.server.frontend.service.port }}
value: {{ include "temporal.fullname" $ }}-frontend:{{ .Values.server.frontend.service.port }}
- name: TEMPORAL_ADDRESS
value: {{ include "temporal.fullname" . }}-frontend:{{ .Values.server.frontend.service.port }}
value: {{ include "temporal.fullname" $ }}-frontend:{{ .Values.server.frontend.service.port }}
{{- if .Values.admintools.additionalEnv }}
{{- toYaml .Values.admintools.additionalEnv | nindent 12 }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions charts/temporal/templates/admintools-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "temporal.componentname" (list . "admintools") }}
name: {{ include "temporal.componentname" (list $ "admintools") }}
labels:
{{- include "temporal.resourceLabels" (list . "admintools" "") | nindent 4 }}
{{- include "temporal.resourceLabels" (list $ "admintools" "") | nindent 4 }}
spec:
type: ClusterIP
ports:
Expand All @@ -14,7 +14,7 @@ spec:
name: ssh

selector:
app.kubernetes.io/name: {{ include "temporal.name" . }}
app.kubernetes.io/name: {{ include "temporal.name" $ }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: admintools
{{- end }}
4 changes: 2 additions & 2 deletions charts/temporal/templates/frontend-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ include "temporal.componentname" (list . "frontend") }}
name: {{ include "temporal.componentname" (list $ "frontend") }}
labels:
{{- include "temporal.resourceLabels" (list . "frontend" "") | nindent 4 }}
{{- include "temporal.resourceLabels" (list $ "frontend" "") | nindent 4 }}
{{- with .Values.server.frontend.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/temporal/templates/server-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ kind: ConfigMap
metadata:
name: "{{ include "temporal.fullname" $ }}-config"
labels:
{{- include "temporal.resourceLabels" (list . "" "") | nindent 4 }}
{{- include "temporal.resourceLabels" (list $ "" "") | nindent 4 }}
data:
config_template.yaml: |-
log:
Expand Down
4 changes: 2 additions & 2 deletions charts/temporal/templates/server-dynamicconfigmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: "{{ include "temporal.fullname" . }}-dynamic-config"
name: "{{ include "temporal.fullname" $ }}-dynamic-config"
labels:
{{- include "temporal.resourceLabels" (list . "" "") | nindent 4 }}
{{- include "temporal.resourceLabels" (list $ "" "") | nindent 4 }}
data:
dynamic_config.yaml: |-
{{- if $.Values.server.dynamicConfig }}
Expand Down
10 changes: 5 additions & 5 deletions charts/temporal/templates/server-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "temporal.componentname" (list . "schema") }}
name: {{ include "temporal.componentname" (list $ "schema") }}
labels:
{{- include "temporal.resourceLabels" (list . "database" "") | nindent 4 }}
{{- include "temporal.resourceLabels" (list $ "database" "") | nindent 4 }}
spec:
backoffLimit: {{ $.Values.schema.setup.backoffLimit }}
template:
metadata:
name: {{ include "temporal.componentname" (list . "schema") }}
name: {{ include "temporal.componentname" (list $ "schema") }}
labels:
{{- include "temporal.resourceLabels" (list . "database" "") | nindent 8 }}
{{- include "temporal.resourceLabels" (list $ "database" "") | nindent 8 }}
{{- with $.Values.schema.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand All @@ -20,7 +20,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- include "temporal.serviceAccount" . }}
{{- include "temporal.serviceAccount" $ }}
restartPolicy: OnFailure
initContainers:
{{- if $.Values.cassandra.enabled }}
Expand Down
2 changes: 1 addition & 1 deletion charts/temporal/templates/server-pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ kind: PodDisruptionBudget
metadata:
name: {{ include "temporal.componentname" (list $ $service) }}-pdb
labels:
{{- include "temporal.resourceLabels" (list . $service "") | nindent 4 }}
{{- include "temporal.resourceLabels" (list $ $service "") | nindent 4 }}
spec:
{{ toYaml $serviceValues.podDisruptionBudget }}
selector:
Expand Down
4 changes: 2 additions & 2 deletions charts/temporal/templates/server-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "temporal.componentname" (list . "frontend") }}
name: {{ include "temporal.componentname" (list $ "frontend") }}
labels:
{{- include "temporal.resourceLabels" (list $ "frontend" "") | nindent 4 }}
{{- if .Values.server.frontend.service.annotations }}
Expand All @@ -24,7 +24,7 @@ spec:
name: http
# TODO: Allow customizing the node HTTP port
selector:
app.kubernetes.io/name: {{ include "temporal.name" . }}
app.kubernetes.io/name: {{ include "temporal.name" $ }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: frontend

Expand Down
4 changes: 2 additions & 2 deletions charts/temporal/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "temporal.serviceAccountName" . }}
name: {{ include "temporal.serviceAccountName" $ }}
labels:
{{- include "temporal.resourceLabels" (list . "" "") | nindent 4 }}
{{- include "temporal.resourceLabels" (list $ "" "") | nindent 4 }}
annotations:
helm.sh/hook: pre-install, pre-upgrade
helm.sh/hook-weight: "-10"
Expand Down
10 changes: 5 additions & 5 deletions charts/temporal/templates/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "temporal.componentname" (list . "web") }}
name: {{ include "temporal.componentname" (list $ "web") }}
labels:
{{- include "temporal.resourceLabels" (list . "web" "") | nindent 4 }}
{{- include "temporal.resourceLabels" (list $ "web" "") | nindent 4 }}
spec:
replicas: {{ .Values.web.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "temporal.name" . }}
app.kubernetes.io/name: {{ include "temporal.name" $ }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: web
template:
Expand All @@ -21,7 +21,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{ include "temporal.serviceAccount" . }}
{{ include "temporal.serviceAccount" $ }}
{{- if .Values.web.additionalVolumes }}
volumes:
{{- toYaml .Values.web.additionalVolumes | nindent 8 }}
Expand All @@ -32,7 +32,7 @@ spec:
imagePullPolicy: {{ .Values.web.image.pullPolicy }}
env:
- name: TEMPORAL_ADDRESS
value: "{{ include "temporal.fullname" . }}-frontend.{{ .Release.Namespace }}.svc:{{ .Values.server.frontend.service.port }}"
value: "{{ include "temporal.fullname" $ }}-frontend.{{ .Release.Namespace }}.svc:{{ .Values.server.frontend.service.port }}"
{{- if .Values.web.additionalEnv }}
{{- toYaml .Values.web.additionalEnv | nindent 12 }}
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions charts/temporal/templates/web-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ include "temporal.componentname" (list . "web") }}
name: {{ include "temporal.componentname" (list $ "web") }}
labels:
{{- include "temporal.resourceLabels" (list . "web" "") | nindent 4 }}
{{- include "temporal.resourceLabels" (list $ "web" "") | nindent 4 }}
{{- with .Values.web.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/temporal/templates/web-pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "temporal.componentname" (list . "web") }}-pdb
name: {{ include "temporal.componentname" (list $ "web") }}-pdb
labels:
{{- include "temporal.resourceLabels" (list . "web" "") | nindent 4 }}
{{- include "temporal.resourceLabels" (list $ "web" "") | nindent 4 }}
spec:
{{ toYaml $.Values.web.podDisruptionBudget }}
selector:
Expand Down
6 changes: 3 additions & 3 deletions charts/temporal/templates/web-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "temporal.componentname" (list . "web") }}
name: {{ include "temporal.componentname" (list $ "web") }}
labels:
{{- include "temporal.resourceLabels" (list . "web" "") | nindent 4 }}
{{- include "temporal.resourceLabels" (list $ "web" "") | nindent 4 }}
{{- if .Values.web.service.annotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.web.service.annotations "context" $) | nindent 4 }}
{{- end }}
Expand All @@ -22,7 +22,7 @@ spec:
nodePort: {{ .Values.web.service.nodePort }}
{{- end }}
selector:
app.kubernetes.io/name: {{ include "temporal.name" . }}
app.kubernetes.io/name: {{ include "temporal.name" $ }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: web
{{- end }}

0 comments on commit 4c3a155

Please sign in to comment.