Skip to content

Commit 70f3cc0

Browse files
authored
chore(helm): Reformat helm chart templates (#23681)
1 parent 0ad6c87 commit 70f3cc0

16 files changed

+284
-350
lines changed

helm/superset/templates/NOTES.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
*/}}
1919
1. Get the application URL by running these commands:
2020
{{- if .Values.ingress.enabled }}
21-
{{- range .Values.ingress.hosts }}
21+
{{- range .Values.ingress.hosts }}
2222
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}
23-
{{- end }}
23+
{{- end }}
2424
{{- else if contains "NodePort" .Values.service.type }}
2525
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "superset.fullname" . }})
2626
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")

helm/superset/templates/_helpers.tpl

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
Expand the name of the chart.
2222
*/}}
2323
{{- define "superset.name" -}}
24-
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
24+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
2525
{{- end -}}
2626

2727
{{/*
@@ -30,34 +30,34 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
3030
If release name contains chart name it will be used as a full name.
3131
*/}}
3232
{{- define "superset.fullname" -}}
33-
{{- if .Values.fullnameOverride -}}
34-
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
35-
{{- else -}}
36-
{{- $name := default .Chart.Name .Values.nameOverride -}}
37-
{{- if contains $name .Release.Name -}}
38-
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
39-
{{- else -}}
40-
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
41-
{{- end -}}
42-
{{- end -}}
33+
{{- if .Values.fullnameOverride -}}
34+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
35+
{{- else -}}
36+
{{- $name := default .Chart.Name .Values.nameOverride -}}
37+
{{- if contains $name .Release.Name -}}
38+
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
39+
{{- else -}}
40+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
41+
{{- end -}}
42+
{{- end -}}
4343
{{- end -}}
4444

4545
{{/*
4646
Create the name of the service account to use
4747
*/}}
4848
{{- define "superset.serviceAccountName" -}}
49-
{{- if .Values.serviceAccount.create -}}
50-
{{- default (include "superset.fullname" .) .Values.serviceAccountName -}}
51-
{{- else -}}
52-
{{- default "default" .Values.serviceAccountName -}}
53-
{{- end -}}
49+
{{- if .Values.serviceAccount.create -}}
50+
{{- default (include "superset.fullname" .) .Values.serviceAccountName -}}
51+
{{- else -}}
52+
{{- default "default" .Values.serviceAccountName -}}
53+
{{- end -}}
5454
{{- end -}}
5555

5656
{{/*
5757
Create chart name and version as used by the chart label.
5858
*/}}
5959
{{- define "superset.chart" -}}
60-
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
60+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
6161
{{- end -}}
6262

6363
{{- define "superset-config" }}
@@ -86,20 +86,20 @@ SECRET_KEY = env('SECRET_KEY', 'thisISaSECRET_1234')
8686
class CeleryConfig(object):
8787
CELERY_IMPORTS = ('superset.sql_lab', )
8888
CELERY_ANNOTATIONS = {'tasks.add': {'rate_limit': '10/s'}}
89-
{{- if .Values.supersetNode.connections.redis_password }}
89+
{{- if .Values.supersetNode.connections.redis_password }}
9090
BROKER_URL = f"redis://:{env('REDIS_PASSWORD')}@{env('REDIS_HOST')}:{env('REDIS_PORT')}/0"
9191
CELERY_RESULT_BACKEND = f"redis://:{env('REDIS_PASSWORD')}@{env('REDIS_HOST')}:{env('REDIS_PORT')}/0"
92-
{{- else }}
92+
{{- else }}
9393
BROKER_URL = f"redis://{env('REDIS_HOST')}:{env('REDIS_PORT')}/0"
9494
CELERY_RESULT_BACKEND = f"redis://{env('REDIS_HOST')}:{env('REDIS_PORT')}/0"
95-
{{- end }}
95+
{{- end }}
9696

9797
CELERY_CONFIG = CeleryConfig
9898
RESULTS_BACKEND = RedisCache(
9999
host=env('REDIS_HOST'),
100-
{{- if .Values.supersetNode.connections.redis_password }}
100+
{{- if .Values.supersetNode.connections.redis_password }}
101101
password=env('REDIS_PASSWORD'),
102-
{{- end }}
102+
{{- end }}
103103
port=env('REDIS_PORT'),
104104
key_prefix='superset_results'
105105
)
@@ -111,6 +111,7 @@ RESULTS_BACKEND = RedisCache(
111111
{{ tpl $value $ }}
112112
{{- end }}
113113
{{- end }}
114+
114115
{{ if .Values.configOverridesFiles }}
115116
# Overrides from files
116117
{{- $files := .Files }}

helm/superset/templates/configmap-superset.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ apiVersion: v1
1919
kind: ConfigMap
2020
metadata:
2121
name: {{ template "superset.fullname" . }}-extra-config
22+
namespace: {{ .Release.Namespace }}
2223
labels:
2324
app: {{ template "superset.name" . }}
2425
chart: {{ template "superset.chart" . }}
2526
release: {{ .Release.Name }}
2627
heritage: {{ .Release.Service }}
27-
namespace: {{ .Release.Namespace }}
2828
data:
29-
{{- range $path, $config := .Values.extraConfigs }}
29+
{{- range $path, $config := .Values.extraConfigs }}
3030
{{ $path }}: |
31-
{{- tpl $config $ | nindent 4 -}}
32-
{{- end -}}
31+
{{- tpl $config $ | nindent 4 -}}
32+
{{- end -}}
3333
{{- end -}}

helm/superset/templates/deployment-beat.yaml

Lines changed: 35 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@ apiVersion: apps/v1
1919
kind: Deployment
2020
metadata:
2121
name: {{ template "superset.fullname" . }}-celerybeat
22+
namespace: {{ .Release.Namespace }}
2223
labels:
2324
app: {{ template "superset.name" . }}-celerybeat
2425
chart: {{ template "superset.chart" . }}
2526
release: {{ .Release.Name }}
2627
heritage: {{ .Release.Service }}
27-
{{- if .Values.supersetCeleryBeat.deploymentAnnotations }}
28-
annotations:
29-
{{- toYaml .Values.supersetCeleryBeat.deploymentAnnotations | nindent 4 }}
30-
{{- end }}
31-
namespace: {{ .Release.Namespace }}
28+
{{- if .Values.supersetCeleryBeat.deploymentAnnotations }}
29+
annotations: {{- toYaml .Values.supersetCeleryBeat.deploymentAnnotations | nindent 4 }}
30+
{{- end }}
3231
spec:
3332
# This must be a singleton
3433
replicas: 1
@@ -46,31 +45,30 @@ spec:
4645
checksum/extraSecretEnv: {{ .Values.extraSecretEnv | toYaml | sha256sum }}
4746
checksum/configOverrides: {{ .Values.configOverrides | toYaml | sha256sum }}
4847
checksum/configOverridesFiles: {{ .Values.configOverridesFiles | toYaml | sha256sum }}
49-
{{ if .Values.supersetCeleryBeat.forceReload }}
48+
{{- if .Values.supersetCeleryBeat.forceReload }}
5049
# Optionally force the thing to reload
5150
force-reload: {{ randAlphaNum 5 | quote }}
52-
{{ end }}
53-
{{- if .Values.supersetCeleryBeat.podAnnotations }}
54-
{{- toYaml .Values.supersetCeleryBeat.podAnnotations | nindent 8 }}
55-
{{- end }}
51+
{{- end }}
52+
{{- if .Values.supersetCeleryBeat.podAnnotations }}
53+
{{- toYaml .Values.supersetCeleryBeat.podAnnotations | nindent 8 }}
54+
{{- end }}
5655
labels:
5756
app: "{{ template "superset.name" . }}-celerybeat"
5857
release: {{ .Release.Name }}
59-
{{- if .Values.supersetCeleryBeat.podLabels }}
60-
{{- toYaml .Values.supersetCeleryBeat.podLabels | nindent 8 }}
61-
{{- end }}
58+
{{- if .Values.supersetCeleryBeat.podLabels }}
59+
{{- toYaml .Values.supersetCeleryBeat.podLabels | nindent 8 }}
60+
{{- end }}
6261
spec:
6362
{{- if or (.Values.serviceAccount.create) (.Values.serviceAccountName) }}
6463
serviceAccountName: {{ template "superset.serviceAccountName" . }}
6564
{{- end }}
6665
securityContext:
6766
runAsUser: {{ .Values.runAsUser }}
68-
{{- if .Values.supersetCeleryBeat.podSecurityContext }}
69-
{{- toYaml .Values.supersetCeleryBeat.podSecurityContext | nindent 8 }}
70-
{{- end }}
67+
{{- if .Values.supersetCeleryBeat.podSecurityContext }}
68+
{{- toYaml .Values.supersetCeleryBeat.podSecurityContext | nindent 8 }}
69+
{{- end }}
7170
{{- if .Values.supersetCeleryBeat.initContainers }}
72-
initContainers:
73-
{{- tpl (toYaml .Values.supersetCeleryBeat.initContainers) . | nindent 6 }}
71+
initContainers: {{- tpl (toYaml .Values.supersetCeleryBeat.initContainers) . | nindent 6 }}
7472
{{- end }}
7573
{{- with .Values.hostAliases }}
7674
hostAliases: {{- toYaml . | nindent 6 }}
@@ -91,7 +89,7 @@ spec:
9189
value: {{ $value | quote }}
9290
{{- end }}
9391
{{- if .Values.extraEnvRaw }}
94-
{{- toYaml .Values.extraEnvRaw | nindent 12 }}
92+
{{- toYaml .Values.extraEnvRaw | nindent 12 }}
9593
{{- end }}
9694
envFrom:
9795
- secretRef:
@@ -109,44 +107,41 @@ spec:
109107
mountPath: {{ .Values.extraConfigMountPath | quote }}
110108
readOnly: true
111109
{{- end }}
112-
{{- with .Values.extraVolumeMounts }}
113-
{{- tpl (toYaml .) $ | nindent 12 -}}
114-
{{- end }}
110+
{{- with .Values.extraVolumeMounts }}
111+
{{- tpl (toYaml .) $ | nindent 12 }}
112+
{{- end }}
115113
resources:
116-
{{- if .Values.supersetCeleryBeat.resources }}
117-
{{- toYaml .Values.supersetCeleryBeat.resources | nindent 12 }}
118-
{{- else }}
119-
{{- toYaml .Values.resources | nindent 12 }}
120-
{{- end }}
114+
{{- if .Values.supersetCeleryBeat.resources }}
115+
{{- toYaml .Values.supersetCeleryBeat.resources | nindent 12 }}
116+
{{- else }}
117+
{{- toYaml .Values.resources | nindent 12 }}
118+
{{- end }}
121119
{{- with .Values.nodeSelector }}
122-
nodeSelector:
123-
{{- toYaml . | nindent 8 }}
120+
nodeSelector: {{- toYaml . | nindent 8 }}
124121
{{- end }}
125122
{{- if or .Values.affinity .Values.supersetCeleryBeat.affinity }}
126123
affinity:
127124
{{- with .Values.affinity }}
128-
{{- toYaml . | nindent 8 }}
125+
{{- toYaml . | nindent 8 }}
129126
{{- end }}
130127
{{- with .Values.supersetCeleryBeat.affinity }}
131-
{{- toYaml . | nindent 8 }}
128+
{{- toYaml . | nindent 8 }}
132129
{{- end }}
133130
{{- end }}
134131
{{- if or .Values.topologySpreadConstraints .Values.supersetCeleryBeat.topologySpreadConstraints }}
135132
topologySpreadConstraints:
136133
{{- with .Values.topologySpreadConstraints }}
137-
{{- toYaml . | nindent 8 }}
134+
{{- toYaml . | nindent 8 }}
138135
{{- end }}
139136
{{- with .Values.supersetCeleryBeat.topologySpreadConstraints }}
140-
{{- toYaml . | nindent 8 }}
137+
{{- toYaml . | nindent 8 }}
141138
{{- end }}
142139
{{- end }}
143140
{{- with .Values.tolerations }}
144-
tolerations:
145-
{{- toYaml . | nindent 8 }}
141+
tolerations: {{- toYaml . | nindent 8 }}
146142
{{- end }}
147143
{{- if .Values.imagePullSecrets }}
148-
imagePullSecrets:
149-
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
144+
imagePullSecrets: {{- toYaml .Values.imagePullSecrets | nindent 8 }}
150145
{{- end }}
151146
volumes:
152147
- name: superset-config
@@ -157,7 +152,7 @@ spec:
157152
configMap:
158153
name: {{ template "superset.fullname" . }}-extra-config
159154
{{- end }}
160-
{{- with .Values.extraVolumes }}
161-
{{- tpl (toYaml .) $ | nindent 8 -}}
162-
{{- end }}
155+
{{- with .Values.extraVolumes }}
156+
{{- tpl (toYaml .) $ | nindent 8 -}}
157+
{{- end }}
163158
{{- end -}}

0 commit comments

Comments
 (0)