Skip to content

Commit

Permalink
feat: init-container when using dynamic persistence (8gears#82)
Browse files Browse the repository at this point in the history
* feat: init-container when using dynamic persistence

* fix: use `n8n` image instead of `busybox`

- 8gears#82 (comment)

fix the artifacthub.io/changes in `Chart.yaml`

- 8gears#82 (comment)
  • Loading branch information
Karitham committed Mar 15, 2024
1 parent e9f17df commit f50ba42
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: n8n
version: 0.22.0
version: 0.23.0
appVersion: 1.30.0
type: application

Expand Down Expand Up @@ -29,8 +29,8 @@ annotations:
artifacthub.io/prerelease: "true"
# supported kinds are added, changed, deprecated, removed, fixed and security.
artifacthub.io/changes: |
- kind: changed
description: "Apply Security Context to all Pods"
- kind: fixed
description: "Fixed issue with dynamic volumes not having the correct directories laid out"
links:
- name: "Related GitHub Issue"
url: https://github.com/8gears/n8n-helm-chart/issues/71
url: https://github.com/8gears/n8n-helm-chart/issues/71
12 changes: 11 additions & 1 deletion templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,20 @@ spec:
serviceAccountName: {{ include "n8n.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if .Values.initContainers }}
{{- if or .Values.initContainers (and .Values.persistence.enabled (eq .Values.persistence.type "dynamic")) }}
initContainers:
{{- if and .Values.persistence.enabled (eq .Values.persistence.type "dynamic") }}
- name: init-data-dir
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
command: ["/bin/sh", "-c", "mkdir -p /home/node/.n8n/"]
volumeMounts:
- name: data
mountPath: /home/node/.n8n
{{- end }}
{{- if .Values.initContainers }}
{{ tpl (toYaml .Values.initContainers) . | nindent 8 }}
{{- end }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{- with .Values.command }}
Expand Down

0 comments on commit f50ba42

Please sign in to comment.