Skip to content

Commit

Permalink
helm: use alpine for init-secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
sonroyaalmerol authored May 17, 2024
1 parent 8c38106 commit e1a34b8
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions charts/sogo/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ spec:
readOnly: true
{{- end }}
{{- if .Values.sogo.existingSecrets }}
- name: {{ template "sogo.fullname" . }}-shared
- name: {{ template "sogo.fullname" . }}-tmp
mountPath: /etc/sogo/sogo.conf.d/99-existing-secrets.yaml
subPath: existing-secrets.yaml
readOnly: true
Expand Down Expand Up @@ -174,12 +174,12 @@ spec:
{{- end }}
{{- end }}
- name: init-secrets
image: busybox
image: alpine:3.19
volumeMounts:
- name: {{ template "sogo.fullname" . }}-shared
- name: {{ template "sogo.fullname" . }}-tmp
mountPath: /secrets
{{- range .Values.sogo.existingSecrets }}
- name: {{ .configName | lower }}
- name: {{ printf "external-%s" .configName | lower }}
mountPath: {{ printf "/existing-secrets/%s" .configName }}
subPath: {{ .key }}
readOnly: true
Expand All @@ -194,15 +194,14 @@ spec:
fi
output_file="/secrets/existing-secrets.yaml"
> "$output_file"
: > "$output_file" # Initialize (truncate) the output file
for file in /existing-secrets/*; do
filename=$(basename "$file")
content=$(cat "$file")
echo "$filename: |" >> "$output_file"
echo "$filename: >-" >> "$output_file"
while IFS= read -r line; do
echo " $line" >> "$output_file"
done <<< "$content"
done < "$file"
done
{{- if or .Values.mariadb.enabled (eq (include "sogo.db.parsed.type" .) "mysql") }}
- name: mariadb-isalive
Expand Down Expand Up @@ -264,11 +263,11 @@ spec:
secretName: {{ template "sogo.fullname" . }}-secret
{{- end }}
{{- range .Values.sogo.existingSecrets }}
- name: {{ .configName | lower }}
- name: {{ printf "external-%s" .configName | lower }}
secret:
secretName: {{ .name }}
{{- end }}
- name: {{ template "sogo.fullname" . }}-shared
- name: {{ template "sogo.fullname" . }}-tmp
emptyDir: {}
{{- with .Values.sogo.extraVolumes }}
{{- toYaml . | nindent 8 }}
Expand Down

0 comments on commit e1a34b8

Please sign in to comment.