diff --git a/charts/spire/charts/tornjak-frontend/README.md b/charts/spire/charts/tornjak-frontend/README.md index 0216f45..208aab7 100644 --- a/charts/spire/charts/tornjak-frontend/README.md +++ b/charts/spire/charts/tornjak-frontend/README.md @@ -89,7 +89,7 @@ port forwarding. See the chart NOTES output for more details. | `startupProbe.failureThreshold` | Failure threshold count for startupProbe | `6` | | `startupProbe.successThreshold` | Success threshold count for startupProbe | `1` | | `workingDir` | Set to override the default path containing the Tornjak frontend within the image | `""` | -| `logsDir` | Directory path for NPM logs | `/home/node/` | +| `logsDir` | Directory path for NPM logs | `""` | | `ingress.enabled` | Flag to enable ingress for Tornjak frontend service | `false` | | `ingress.className` | Ingress class name for Tornjak frontend service | `""` | | `ingress.controllerType` | Specify what type of ingress controller you're using to add the necessary annotations accordingly. If blank, auto-detection is attempted. If other, no annotations will be added. Must be one of [ingress-nginx, openshift, other, ""]. | `""` | diff --git a/charts/spire/charts/tornjak-frontend/templates/_helpers.tpl b/charts/spire/charts/tornjak-frontend/templates/_helpers.tpl index c810f0f..d368124 100644 --- a/charts/spire/charts/tornjak-frontend/templates/_helpers.tpl +++ b/charts/spire/charts/tornjak-frontend/templates/_helpers.tpl @@ -100,3 +100,13 @@ Create URL for accessing Tornjak APIs {{- printf "/usr/src/app" }} {{- end }} {{- end }} + +{{- define "tornjak-frontend.logsDir" }} +{{- if .Values.logsDir }} +{{- .Values.logsDir }} +{{- else if (dig "openshift" false .Values.global) }} +{{- printf "/opt/app-root/src/.npm/_cacache/" }} +{{- else }} +{{- printf "/home/node/" }} +{{- end }} +{{- end }} diff --git a/charts/spire/charts/tornjak-frontend/templates/deployment.yaml b/charts/spire/charts/tornjak-frontend/templates/deployment.yaml index 97d187a..e70b5c0 100644 --- a/charts/spire/charts/tornjak-frontend/templates/deployment.yaml +++ b/charts/spire/charts/tornjak-frontend/templates/deployment.yaml @@ -61,7 +61,7 @@ spec: - name: env mountPath: {{ include "tornjak-frontend.workingDir" . }}/build/tmp - name: logs - mountPath: {{ .Values.logsDir }} + mountPath: {{ include "tornjak-frontend.logsDir" . }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/spire/charts/tornjak-frontend/values.yaml b/charts/spire/charts/tornjak-frontend/values.yaml index 44ae3ec..b7aab01 100644 --- a/charts/spire/charts/tornjak-frontend/values.yaml +++ b/charts/spire/charts/tornjak-frontend/values.yaml @@ -120,7 +120,7 @@ startupProbe: workingDir: "" ## @param logsDir Directory path for NPM logs -logsDir: "/home/node/" +logsDir: "" ## @param ingress.enabled Flag to enable ingress for Tornjak frontend service ## @param ingress.className Ingress class name for Tornjak frontend service