Fix Tornjak logsDir for Openshift (#344)

* Fix Tornjak logsDir for Openshift

Signed-off-by: Mariusz Sabath <[email protected]>

* Update docs

Signed-off-by: Mariusz Sabath <[email protected]>

* Update charts/spire/charts/tornjak-frontend/templates/_helpers.tpl

Co-authored-by: kfox1111 <[email protected]>
Signed-off-by: Mariusz Sabath <[email protected]>

---------

Signed-off-by: Mariusz Sabath <[email protected]>
Co-authored-by: kfox1111 <[email protected]>
This commit is contained in:
Mariusz Sabath
2024-05-03 08:04:38 -07:00
committed by GitHub
co-authored by kfox1111
parent 8fef1bd050
commit c37de1ea0c
4 changed files with 13 additions and 3 deletions
@@ -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, ""]. | `""` |
@@ -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 }}
@@ -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 }}
@@ -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