-
Notifications
You must be signed in to change notification settings - Fork 246
feat: improve deployment modes and persistence validation #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| {{- if .Values.webhook.enabled }} | ||
| {{- /* Validate Valkey/Redis configuration */}} | ||
| {{- include "n8n.validateValkey" . }} | ||
| {{- include "n8n.validateValues" . }} | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
|
|
@@ -33,7 +34,7 @@ spec: | |
| template: | ||
| metadata: | ||
| annotations: | ||
| checksum/config: {{ print .Values.webhook .Values.main | sha256sum }} | ||
| checksum/config: {{ print .Values.webhook | sha256sum }} | ||
| {{- with .Values.webhook.podAnnotations }} | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
|
|
@@ -57,6 +58,8 @@ spec: | |
| {{- end }} | ||
| containers: | ||
| - name: {{ .Chart.Name }}-webhook | ||
| securityContext: | ||
| {{- toYaml .Values.webhook.securityContext | nindent 12 }} | ||
| image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
| imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
| {{- if .Values.webhook.command }} | ||
|
|
@@ -101,21 +104,20 @@ spec: | |
| - secretRef: | ||
| name: {{ include "n8n.fullname" . }}-webhook-secret | ||
| {{- end }} | ||
|
|
||
| env: {{ not (empty .Values.webhook.extraEnv) | ternary nil "[]" }} | ||
| {{- range $key, $value := .Values.webhook.extraEnv }} | ||
| - name: {{ $key }} | ||
| {{- toYaml $value | nindent 14 }} | ||
| {{- end }} | ||
| lifecycle: | ||
| {{- toYaml .Values.webhook.lifecycle | nindent 12 }} | ||
| securityContext: | ||
| {{- toYaml .Values.webhook.securityContext | nindent 12 }} | ||
| resources: | ||
| {{- toYaml .Values.webhook.resources | nindent 12 }} | ||
| {{- if .Values.webhook.persistence.enabled }} | ||
| volumeMounts: | ||
| - name: data | ||
| mountPath: /home/node/.n8n | ||
| {{- end }} | ||
| {{- if .Values.webhook.extraVolumeMounts }} | ||
| {{- toYaml .Values.webhook.extraVolumeMounts | nindent 12 }} | ||
| {{- end }} | ||
|
Comment on lines
+116
to
123
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Render volumeMounts only when there is content Avoid emitting an empty - {{- if .Values.webhook.persistence.enabled }}
- volumeMounts:
- - name: data
- mountPath: /home/node/.n8n
- {{- end }}
- {{- if .Values.webhook.extraVolumeMounts }}
- {{- toYaml .Values.webhook.extraVolumeMounts | nindent 12 }}
- {{- end }}
+ {{- if or .Values.webhook.persistence.enabled .Values.webhook.extraVolumeMounts }}
+ volumeMounts:
+ {{- if .Values.webhook.persistence.enabled }}
+ - name: data
+ mountPath: /home/node/.n8n
+ {{- end }}
+ {{- if .Values.webhook.extraVolumeMounts }}
+{{ toYaml .Values.webhook.extraVolumeMounts | nindent 12 }}
+ {{- end }}
+ {{- end }}
🤖 Prompt for AI Agents |
||
|
|
@@ -136,8 +138,10 @@ spec: | |
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| volumes: | ||
| {{- if .Values.webhook.persistence.enabled }} | ||
| - name: "data" | ||
| {{ include "n8n.pvc" . }} | ||
| {{ include "n8n.webhook.pvc" . }} | ||
| {{- end }} | ||
| {{- if .Values.webhook.extraVolumes }} | ||
| {{- toYaml .Values.webhook.extraVolumes | nindent 8 }} | ||
| {{- end }} | ||
|
Comment on lines
140
to
147
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guard the volumes section to avoid an empty key
- volumes:
- {{- if .Values.webhook.persistence.enabled }}
- - name: "data"
- {{ include "n8n.webhook.pvc" . }}
- {{- end }}
- {{- if .Values.webhook.extraVolumes }}
- {{- toYaml .Values.webhook.extraVolumes | nindent 8 }}
- {{- end }}
+ {{- if or .Values.webhook.persistence.enabled .Values.webhook.extraVolumes }}
+ volumes:
+ {{- if .Values.webhook.persistence.enabled }}
+ - name: data
+{{ include "n8n.webhook.pvc" . | nindent 10 }}
+ {{- end }}
+ {{- if .Values.webhook.extraVolumes }}
+{{ toYaml .Values.webhook.extraVolumes | nindent 8 }}
+ {{- end }}
+ {{- end }}
🤖 Prompt for AI Agents |
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.