Skip to content

Commit

Permalink
helm-chart: simplify logic around image for initcontainers
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L. <szaimen@e.mail.de>
  • Loading branch information
szaimen committed Aug 16, 2024
1 parent 6a383ef commit e74f52a
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ spec:
spec:
initContainers:
- name: init-volumes
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG }}alpine"
{{- else }}
image: alpine
{{- end }}
command:
- chmod
- "777"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ spec:
spec:
initContainers:
- name: init-subpath
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG }}alpine"
{{- else }}
image: alpine
{{- end }}
command:
- mkdir
- "-p"
Expand All @@ -40,11 +36,7 @@ spec:
- name: nextcloud-aio-clamav
mountPath: /nextcloud-aio-clamav
- name: init-volumes
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG }}alpine"
{{- else }}
image: alpine
{{- end }}
command:
- chown
- 100:100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ spec:
spec:
initContainers:
- name: init-subpath
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG }}alpine"
{{- else }}
image: alpine
{{- end }}
command:
- mkdir
- "-p"
Expand All @@ -42,11 +38,7 @@ spec:
- name: nextcloud-aio-database
mountPath: /nextcloud-aio-database
- name: init-volumes
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG }}alpine"
{{- else }}
image: alpine
{{- end }}
command:
- chown
- 999:999
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ spec:
spec:
initContainers:
- name: init-volumes
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG }}alpine"
{{- else }}
image: alpine
{{- end }}
command:
- chmod
- "777"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ spec:
spec:
initContainers:
- name: "delete-lost-found"
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG }}alpine"
{{- else }}
image: alpine
{{- end }}
command:
- rm
- "-rf"
Expand All @@ -40,11 +36,7 @@ spec:
- name: nextcloud-aio-nextcloud
mountPath: /nextcloud-aio-nextcloud
- name: init-volumes
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG }}alpine"
{{- else }}
image: alpine
{{- end }}
command:
- chmod
- "777"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ spec:
spec:
initContainers:
- name: init-volumes
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG }}alpine"
{{- else }}
image: alpine
{{- end }}
command:
- chmod
- "777"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ spec:
spec:
initContainers:
- name: init-volumes
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG }}alpine"
{{- else }}
image: alpine
{{- end }}
command:
- chmod
- "777"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ spec:
spec:
initContainers:
- name: init-volumes
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG }}alpine"
{{- else }}
image: alpine
{{- end }}
command:
- chmod
- "777"
Expand Down
27 changes: 0 additions & 27 deletions nextcloud-aio-helm-chart/update-helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ find ./ -name '*networkpolicy.yaml' -exec sed -i "s|manual-install-nextcloud-aio
cat << EOL > /tmp/initcontainers
initContainers:
- name: init-volumes
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG }}alpine"
{{- else }}
image: alpine
{{- end }}
command:
- chmod
- "777"
Expand All @@ -72,22 +68,14 @@ EOL
cat << EOL > /tmp/initcontainers.database
initContainers:
- name: init-subpath
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG }}alpine"
{{- else }}
image: alpine
{{- end }}
command:
- mkdir
- "-p"
- /nextcloud-aio-database/data
volumeMountsInitContainer:
- name: init-volumes
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG }}alpine"
{{- else }}
image: alpine
{{- end }}
command:
- chown
- 999:999
Expand All @@ -97,22 +85,14 @@ EOL
cat << EOL > /tmp/initcontainers.clamav
initContainers:
- name: init-subpath
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG }}alpine"
{{- else }}
image: alpine
{{- end }}
command:
- mkdir
- "-p"
- /nextcloud-aio-clamav/data
volumeMountsInitContainer:
- name: init-volumes
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG }}alpine"
{{- else }}
image: alpine
{{- end }}
command:
- chown
- 100:100
Expand All @@ -122,22 +102,15 @@ EOL
cat << EOL > /tmp/initcontainers.nextcloud
initContainers:
- name: "delete-lost-found"
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG }}alpine"
{{- else }}
image: alpine
{{- end }}
command:
- rm
- "-rf"
- "/nextcloud-aio-nextcloud/lost+found"
volumeMountsInitRmLostFound:
- name: init-volumes
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG }}alpine"
{{- else }}
image: alpine
{{- end }}
command:
- chmod
- "777"
Expand Down

0 comments on commit e74f52a

Please sign in to comment.