Skip to content

Commit a303a5f

Browse files
chore: lint all templates to fix indentation and update style (#465)
* chore: cleanup deployment.yaml Signed-off-by: WrenIX <dev.github@wrenix.eu> * chore: cleanup config.yaml Signed-off-by: WrenIX <dev.github@wrenix.eu> * chore: cleanup db-secret.yaml Signed-off-by: WrenIX <dev.github@wrenix.eu> * chore: revert db-secret.yaml stringData Signed-off-by: WrenIX <dev.github@wrenix.eu> * chore: cleanup _helper.yaml for database Signed-off-by: WrenIX <dev.github@wrenix.eu> * chore: cleanup nextcloud-key to default Signed-off-by: WrenIX <dev.github@wrenix.eu> * chore: put know string into printf Signed-off-by: WrenIX <dev.github@wrenix.eu> * fix: dump version after several cleanups Signed-off-by: WrenIX <dev.github@wrenix.eu> * chore: fix end after cleanup Signed-off-by: WrenIX <133280015+wrenix@users.noreply.github.com> * chore: add some comments for helm-end Signed-off-by: WrenIX <133280015+wrenix@users.noreply.github.com> * chore: remove spaces inside of golang template Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> Signed-off-by: WrenIX <133280015+wrenix@users.noreply.github.com> --------- Signed-off-by: WrenIX <dev.github@wrenix.eu> Signed-off-by: WrenIX <133280015+wrenix@users.noreply.github.com> Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com>
1 parent 2f27a38 commit a303a5f

7 files changed

Lines changed: 376 additions & 373 deletions

File tree

charts/nextcloud/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: nextcloud
3-
version: 4.5.0
3+
version: 4.5.1
44
appVersion: 27.1.3
55
description: A file sharing server that puts the control and security of your own data back into your hands.
66
keywords:

charts/nextcloud/templates/_helpers.tpl

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Create a default fully qualified redis app name.
2828
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
2929
*/}}
3030
{{- define "nextcloud.redis.fullname" -}}
31-
{{- printf "%s-%s" .Release.Name "redis" | trunc 63 | trimSuffix "-" -}}
31+
{{- printf "%s-redis" .Release.Name | trunc 63 | trimSuffix "-" -}}
3232
{{- end -}}
3333

3434
{{/*
@@ -80,13 +80,13 @@ Create environment variables used to configure the nextcloud container as well a
8080
- name: MYSQL_USER
8181
valueFrom:
8282
secretKeyRef:
83-
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-%s" .Release.Name "db") }}
84-
key: {{ .Values.externalDatabase.existingSecret.usernameKey | default "db-username" }}
83+
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
84+
key: {{ .Values.externalDatabase.existingSecret.usernameKey }}
8585
- name: MYSQL_PASSWORD
8686
valueFrom:
8787
secretKeyRef:
88-
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-%s" .Release.Name "db") }}
89-
key: {{ .Values.externalDatabase.existingSecret.passwordKey | default "db-password" }}
88+
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
89+
key: {{ .Values.externalDatabase.existingSecret.passwordKey }}
9090
{{- else if .Values.postgresql.enabled }}
9191
- name: POSTGRES_HOST
9292
value: {{ template "postgresql.v1.primary.fullname" .Subcharts.postgresql }}
@@ -99,20 +99,20 @@ Create environment variables used to configure the nextcloud container as well a
9999
- name: POSTGRES_USER
100100
valueFrom:
101101
secretKeyRef:
102-
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-%s" .Release.Name "db") }}
103-
key: {{ .Values.externalDatabase.existingSecret.usernameKey | default "db-username" }}
102+
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
103+
key: {{ .Values.externalDatabase.existingSecret.usernameKey }}
104104
- name: POSTGRES_PASSWORD
105105
valueFrom:
106106
secretKeyRef:
107-
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-%s" .Release.Name "db") }}
108-
key: {{ .Values.externalDatabase.existingSecret.passwordKey | default "db-password" }}
107+
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
108+
key: {{ .Values.externalDatabase.existingSecret.passwordKey }}
109109
{{- else }}
110110
{{- if eq .Values.externalDatabase.type "postgresql" }}
111111
- name: POSTGRES_HOST
112112
{{- if .Values.externalDatabase.existingSecret.hostKey }}
113113
valueFrom:
114114
secretKeyRef:
115-
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-%s" .Release.Name "db") }}
115+
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
116116
key: {{ .Values.externalDatabase.existingSecret.hostKey }}
117117
{{- else }}
118118
value: {{ .Values.externalDatabase.host | quote }}
@@ -121,27 +121,27 @@ Create environment variables used to configure the nextcloud container as well a
121121
{{- if .Values.externalDatabase.existingSecret.databaseKey }}
122122
valueFrom:
123123
secretKeyRef:
124-
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-%s" .Release.Name "db") }}
124+
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
125125
key: {{ .Values.externalDatabase.existingSecret.databaseKey }}
126126
{{- else }}
127127
value: {{ .Values.externalDatabase.database | quote }}
128128
{{- end }}
129129
- name: POSTGRES_USER
130130
valueFrom:
131131
secretKeyRef:
132-
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-%s" .Release.Name "db") }}
133-
key: {{ .Values.externalDatabase.existingSecret.usernameKey | default "db-username" }}
132+
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
133+
key: {{ .Values.externalDatabase.existingSecret.usernameKey }}
134134
- name: POSTGRES_PASSWORD
135135
valueFrom:
136136
secretKeyRef:
137-
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-%s" .Release.Name "db") }}
138-
key: {{ .Values.externalDatabase.existingSecret.passwordKey | default "db-password" }}
137+
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
138+
key: {{ .Values.externalDatabase.existingSecret.passwordKey }}
139139
{{- else }}
140140
- name: MYSQL_HOST
141141
{{- if .Values.externalDatabase.existingSecret.hostKey }}
142142
valueFrom:
143143
secretKeyRef:
144-
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-%s" .Release.Name "db") }}
144+
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
145145
key: {{ .Values.externalDatabase.existingSecret.hostKey }}
146146
{{- else }}
147147
value: {{ .Values.externalDatabase.host | quote }}
@@ -150,33 +150,33 @@ Create environment variables used to configure the nextcloud container as well a
150150
{{- if .Values.externalDatabase.existingSecret.databaseKey }}
151151
valueFrom:
152152
secretKeyRef:
153-
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-%s" .Release.Name "db") }}
153+
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
154154
key: {{ .Values.externalDatabase.existingSecret.databaseKey }}
155155
{{- else }}
156156
value: {{ .Values.externalDatabase.database | quote }}
157157
{{- end }}
158158
- name: MYSQL_USER
159159
valueFrom:
160160
secretKeyRef:
161-
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-%s" .Release.Name "db") }}
162-
key: {{ .Values.externalDatabase.existingSecret.usernameKey | default "db-username" }}
161+
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
162+
key: {{ .Values.externalDatabase.existingSecret.usernameKey }}
163163
- name: MYSQL_PASSWORD
164164
valueFrom:
165165
secretKeyRef:
166-
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-%s" .Release.Name "db") }}
167-
key: {{ .Values.externalDatabase.existingSecret.passwordKey | default "db-password" }}
166+
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
167+
key: {{ .Values.externalDatabase.existingSecret.passwordKey }}
168168
{{- end }}
169169
{{- end }}
170170
- name: NEXTCLOUD_ADMIN_USER
171171
valueFrom:
172172
secretKeyRef:
173173
name: {{ .Values.nextcloud.existingSecret.secretName | default (include "nextcloud.fullname" .) }}
174-
key: {{ .Values.nextcloud.existingSecret.usernameKey | default "nextcloud-username" }}
174+
key: {{ .Values.nextcloud.existingSecret.usernameKey }}
175175
- name: NEXTCLOUD_ADMIN_PASSWORD
176176
valueFrom:
177177
secretKeyRef:
178178
name: {{ .Values.nextcloud.existingSecret.secretName | default (include "nextcloud.fullname" .) }}
179-
key: {{ .Values.nextcloud.existingSecret.passwordKey | default "nextcloud-password" }}
179+
key: {{ .Values.nextcloud.existingSecret.passwordKey }}
180180
- name: NEXTCLOUD_TRUSTED_DOMAINS
181181
value: {{ .Values.nextcloud.host }}
182182
{{- if ne (int .Values.nextcloud.update) 0 }}
@@ -200,17 +200,17 @@ Create environment variables used to configure the nextcloud container as well a
200200
valueFrom:
201201
secretKeyRef:
202202
name: {{ .Values.nextcloud.existingSecret.secretName | default (include "nextcloud.fullname" .) }}
203-
key: {{ .Values.nextcloud.existingSecret.smtpHostKey | default "smtp-host" }}
203+
key: {{ .Values.nextcloud.existingSecret.smtpHostKey }}
204204
- name: SMTP_NAME
205205
valueFrom:
206206
secretKeyRef:
207207
name: {{ .Values.nextcloud.existingSecret.secretName | default (include "nextcloud.fullname" .) }}
208-
key: {{ .Values.nextcloud.existingSecret.smtpUsernameKey | default "smtp-username" }}
208+
key: {{ .Values.nextcloud.existingSecret.smtpUsernameKey }}
209209
- name: SMTP_PASSWORD
210210
valueFrom:
211211
secretKeyRef:
212212
name: {{ .Values.nextcloud.existingSecret.secretName | default (include "nextcloud.fullname" .) }}
213-
key: {{ .Values.nextcloud.existingSecret.smtpPasswordKey | default "smtp-password" }}
213+
key: {{ .Values.nextcloud.existingSecret.smtpPasswordKey }}
214214
{{- end }}
215215
{{- if .Values.redis.enabled }}
216216
- name: REDIS_HOST
@@ -242,31 +242,31 @@ Create volume mounts for the nextcloud container as well as the cron sidecar con
242242
{{- define "nextcloud.volumeMounts" -}}
243243
- name: nextcloud-main
244244
mountPath: /var/www/
245-
subPath: {{ ternary "root" (printf "%s/%s" .Values.nextcloud.persistence.subPath "root") (empty .Values.nextcloud.persistence.subPath) }}
245+
subPath: {{ ternary "root" (printf "%s/root" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
246246
- name: nextcloud-main
247247
mountPath: /var/www/html
248-
subPath: {{ ternary "html" (printf "%s/%s" .Values.nextcloud.persistence.subPath "html") (empty .Values.nextcloud.persistence.subPath) }}
248+
subPath: {{ ternary "html" (printf "%s/html" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
249249
{{- if and .Values.persistence.nextcloudData.enabled .Values.persistence.enabled }}
250250
- name: nextcloud-data
251251
mountPath: {{ .Values.nextcloud.datadir }}
252-
subPath: {{ ternary "data" (printf "%s/%s" .Values.persistence.nextcloudData.subPath "data") (empty .Values.persistence.nextcloudData.subPath) }}
252+
subPath: {{ ternary "data" (printf "%s/data" .Values.persistence.nextcloudData.subPath) (empty .Values.persistence.nextcloudData.subPath) }}
253253
{{- else }}
254254
- name: nextcloud-main
255255
mountPath: {{ .Values.nextcloud.datadir }}
256-
subPath: {{ ternary "data" (printf "%s/%s" .Values.persistence.subPath "data") (empty .Values.persistence.subPath) }}
256+
subPath: {{ ternary "data" (printf "%s/data" .Values.persistence.subPath) (empty .Values.persistence.subPath) }}
257257
{{- end }}
258258
- name: nextcloud-main
259259
mountPath: /var/www/html/config
260-
subPath: {{ ternary "config" (printf "%s/%s" .Values.nextcloud.persistence.subPath "config") (empty .Values.nextcloud.persistence.subPath) }}
260+
subPath: {{ ternary "config" (printf "%s/config" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
261261
- name: nextcloud-main
262262
mountPath: /var/www/html/custom_apps
263-
subPath: {{ ternary "custom_apps" (printf "%s/%s" .Values.nextcloud.persistence.subPath "custom_apps") (empty .Values.nextcloud.persistence.subPath) }}
263+
subPath: {{ ternary "custom_apps" (printf "%s/custom_apps" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
264264
- name: nextcloud-main
265265
mountPath: /var/www/tmp
266-
subPath: {{ ternary "tmp" (printf "%s/%s" .Values.nextcloud.persistence.subPath "tmp") (empty .Values.nextcloud.persistence.subPath) }}
266+
subPath: {{ ternary "tmp" (printf "%s/tmp" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
267267
- name: nextcloud-main
268268
mountPath: /var/www/html/themes
269-
subPath: {{ ternary "themes" (printf "%s/%s" .Values.nextcloud.persistence.subPath "themes") (empty .Values.nextcloud.persistence.subPath) }}
269+
subPath: {{ ternary "themes" (printf "%s/themes" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
270270
{{- range $key, $value := .Values.nextcloud.configs }}
271271
- name: nextcloud-config
272272
mountPath: /var/www/html/config/{{ $key }}

charts/nextcloud/templates/config.yaml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ metadata:
99
app.kubernetes.io/instance: {{ .Release.Name }}
1010
app.kubernetes.io/managed-by: {{ .Release.Service }}
1111
data:
12-
{{- range $key, $value := .Values.nextcloud.configs }}
12+
{{- range $key, $value := .Values.nextcloud.configs }}
1313
{{ $key }}: |-
14-
{{ $value | indent 4 }}
15-
{{- end }}
16-
{{- if .Values.nextcloud.defaultConfigs }}
17-
{{- if index .Values.nextcloud.defaultConfigs ".htaccess" }}
14+
{{ $value | nindent 4 }}
15+
{{- end }}
16+
{{- if .Values.nextcloud.defaultConfigs }}
17+
{{- if index .Values.nextcloud.defaultConfigs ".htaccess" }}
1818
.htaccess: |-
1919
# line below if for Apache 2.4
2020
<ifModule mod_authz_core.c>
@@ -28,8 +28,8 @@ data:
2828
<ifModule mod_autoindex.c>
2929
IndexIgnore *
3030
</ifModule>
31-
{{- end }}
32-
{{- if index .Values.nextcloud.defaultConfigs "redis.config.php" }}
31+
{{- end }}
32+
{{- if index .Values.nextcloud.defaultConfigs "redis.config.php" }}
3333
redis.config.php: |-
3434
<?php
3535
if (getenv('REDIS_HOST')) {
@@ -39,28 +39,28 @@ data:
3939
'redis' => array(
4040
'host' => getenv('REDIS_HOST'),
4141
'port' => getenv('REDIS_HOST_PORT') ?: 6379,
42-
{{- if .Values.redis.auth.enabled }}
42+
{{- if .Values.redis.auth.enabled }}
4343
'password' => getenv('REDIS_HOST_PASSWORD'),
44-
{{- end }}
44+
{{- end }}
4545
),
4646
);
4747
}
48-
{{- end }}
49-
{{- if index .Values.nextcloud.defaultConfigs "apache-pretty-urls.config.php" }}
48+
{{- end }}
49+
{{- if index .Values.nextcloud.defaultConfigs "apache-pretty-urls.config.php" }}
5050
apache-pretty-urls.config.php: |-
5151
<?php
5252
$CONFIG = array (
5353
'htaccess.RewriteBase' => '/',
5454
);
55-
{{- end }}
56-
{{- if index .Values.nextcloud.defaultConfigs "apcu.config.php" }}
55+
{{- end }}
56+
{{- if index .Values.nextcloud.defaultConfigs "apcu.config.php" }}
5757
apcu.config.php: |-
5858
<?php
5959
$CONFIG = array (
6060
'memcache.local' => '\OC\Memcache\APCu',
6161
);
62-
{{- end }}
63-
{{- if index .Values.nextcloud.defaultConfigs "apps.config.php" }}
62+
{{- end }}
63+
{{- if index .Values.nextcloud.defaultConfigs "apps.config.php" }}
6464
apps.config.php: |-
6565
<?php
6666
$CONFIG = array (
@@ -77,8 +77,8 @@ data:
7777
),
7878
),
7979
);
80-
{{- end }}
81-
{{- if index .Values.nextcloud.defaultConfigs "autoconfig.php" }}
80+
{{- end }}
81+
{{- if index .Values.nextcloud.defaultConfigs "autoconfig.php" }}
8282
autoconfig.php: |-
8383
<?php
8484
$autoconfig_enabled = false;
@@ -104,8 +104,8 @@ data:
104104
if ($autoconfig_enabled) {
105105
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
106106
}
107-
{{- end }}
108-
{{- if index .Values.nextcloud.defaultConfigs "smtp.config.php" }}
107+
{{- end }}
108+
{{- if index .Values.nextcloud.defaultConfigs "smtp.config.php" }}
109109
smtp.config.php: |-
110110
<?php
111111
if (getenv('SMTP_HOST') && getenv('MAIL_FROM_ADDRESS') && getenv('MAIL_DOMAIN')) {
@@ -122,6 +122,6 @@ data:
122122
'mail_domain' => getenv('MAIL_DOMAIN'),
123123
);
124124
}
125-
{{- end }}
126-
{{- end }}
127-
{{- end }}
125+
{{- end }}
126+
{{- end }}{{/* end-if defaultConfigs */}}
127+
{{- end }}{{/* end-if configs */}}

charts/nextcloud/templates/db-secret.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
apiVersion: v1
44
kind: Secret
55
metadata:
6-
name: {{ printf "%s-%s" .Release.Name "db" }}
6+
name: {{ .Release.Name }}-db
77
labels:
88
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
99
helm.sh/chart: {{ include "nextcloud.chart" . }}
@@ -12,14 +12,14 @@ metadata:
1212
type: Opaque
1313
data:
1414
{{- if .Values.mariadb.enabled }}
15-
db-password: {{ default "" .Values.mariadb.auth.password | b64enc | quote }}
16-
db-username: {{ default "" .Values.mariadb.auth.username | b64enc | quote }}
15+
db-username: {{ .Values.mariadb.auth.username | b64enc | quote }}
16+
db-password: {{ .Values.mariadb.auth.password | b64enc | quote }}
1717
{{- else if .Values.postgresql.enabled }}
18-
db-password: {{ default "" .Values.postgresql.global.postgresql.auth.password | b64enc | quote }}
19-
db-username: {{ default "" .Values.postgresql.global.postgresql.auth.username | b64enc | quote }}
18+
db-username: {{ .Values.postgresql.global.postgresql.auth.username | b64enc | quote }}
19+
db-password: {{ .Values.postgresql.global.postgresql.auth.password | b64enc | quote }}
2020
{{- else }}
21-
db-password: {{ default "" .Values.externalDatabase.password | b64enc | quote }}
22-
db-username: {{ default "" .Values.externalDatabase.user | b64enc | quote }}
21+
db-username: {{ .Values.externalDatabase.user | b64enc | quote }}
22+
db-password: {{ .Values.externalDatabase.password | b64enc | quote }}
2323
{{- end }}
2424
{{- end }}
2525
{{- end }}

0 commit comments

Comments
 (0)