Skip to content

Commit

Permalink
fix(nextjs): consolidate volumeMounts and volumes conditionals in web…
Browse files Browse the repository at this point in the history
…-deployment.yaml to prevent duplication and improve readability

chore(nextjs): bump chart version to 1.1.9 to reflect changes in deployment template
  • Loading branch information
masterkain committed Jan 26, 2025
1 parent a65b11d commit 2727992
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion charts/nextjs/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: nextjs
description: Generic Helm chart for Nextjs apps on Kubernetes
type: application
version: 1.1.8
version: 1.1.9
appVersion: '1.0.0'
icon: https://icoretech.github.io/helm/charts/nextjs/logo.png
keywords:
Expand Down
19 changes: 8 additions & 11 deletions charts/nextjs/templates/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,15 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.web.resources | nindent 12 }}
{{- if .Values.web.cachePersistentVolume.enabled }}
volumeMounts:
{{- if .Values.web.cachePersistentVolume.enabled }}
- name: next-cache
mountPath: {{ .Values.web.cachePersistentVolume.mountPath }}
{{- end }}
{{- if .Values.web.dataVolume.enabled }}
volumeMounts:
{{- end }}
{{- if .Values.web.dataVolume.enabled }}
- name: next-data
mountPath: {{ .Values.web.dataVolume.mountPath }}
{{- end }}
{{- end }}
{{- if .Values.web.extraContainers }}
{{- range .Values.web.extraContainers }}
- name: {{ .name | quote }}
Expand Down Expand Up @@ -125,16 +124,14 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

{{- if .Values.web.cachePersistentVolume.enabled }}
volumes:
{{- if .Values.web.cachePersistentVolume.enabled }}
- name: next-cache
persistentVolumeClaim:
claimName: {{ include "app.web.name" . }}-next-cache
{{- end }}
{{- if .Values.web.dataVolume.enabled }}
volumes:
{{- end }}
{{- if .Values.web.dataVolume.enabled }}
- name: next-data
persistentVolumeClaim:
claimName: {{ include "app.web.name" . }}-next-data
{{- end }}
{{- end }}

0 comments on commit 2727992

Please sign in to comment.