From 2727992090fefd31083486cea7ff0a5dc2cd2b57 Mon Sep 17 00:00:00 2001 From: Claudio Poli Date: Sun, 26 Jan 2025 05:23:59 +0100 Subject: [PATCH] fix(nextjs): consolidate volumeMounts and volumes conditionals in web-deployment.yaml to prevent duplication and improve readability chore(nextjs): bump chart version to 1.1.9 to reflect changes in deployment template --- charts/nextjs/Chart.yaml | 2 +- charts/nextjs/templates/web-deployment.yaml | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/charts/nextjs/Chart.yaml b/charts/nextjs/Chart.yaml index 621f758..0d53220 100644 --- a/charts/nextjs/Chart.yaml +++ b/charts/nextjs/Chart.yaml @@ -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: diff --git a/charts/nextjs/templates/web-deployment.yaml b/charts/nextjs/templates/web-deployment.yaml index b9df80b..5ed850e 100644 --- a/charts/nextjs/templates/web-deployment.yaml +++ b/charts/nextjs/templates/web-deployment.yaml @@ -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 }} @@ -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 }}