diff --git a/charts/keep/Chart.yaml b/charts/keep/Chart.yaml index e92eab5..4162022 100644 --- a/charts/keep/Chart.yaml +++ b/charts/keep/Chart.yaml @@ -1,10 +1,10 @@ apiVersion: v2 name: keep -version: 0.1.56 +version: 0.1.57 description: Keep Helm Chart type: application icon: https://platform.keephq.dev/_next/image?url=%2Fkeep.png&w=48&q=75 -appVersion: 0.33.1 +appVersion: 0.33.6 deprecated: false annotations: app: keep diff --git a/charts/keep/templates/_helpers.tpl b/charts/keep/templates/_helpers.tpl index 9ce4f82..670a104 100644 --- a/charts/keep/templates/_helpers.tpl +++ b/charts/keep/templates/_helpers.tpl @@ -80,6 +80,22 @@ Helper function to find an environment variable in the list {{- end -}} {{- end -}} +{{/* +Helper function to find an environment variable in the list +*/}} +{{- define "keep.findBackendEnvVar" -}} +{{- $name := index . 0 -}} +{{- $root := index . 1 -}} +{{- if and $root.Values.backend $root.Values.backend.env -}} + {{- range $root.Values.backend.env -}} + {{- if eq .name $name -}} + {{- .value -}} + {{- end -}} + {{- end -}} +{{- end -}} +{{- end -}} + + {{/* Helper function for websocket host (relative) */}} @@ -187,11 +203,16 @@ Helper function for NEXTAUTH_URL Helper function for KEEP_API_URL that handles both relative and absolute URLs */}} {{- define "keep.keepApiUrl" -}} -{{- $apiUrlClient := include "keep.apiUrlClient" . -}} -{{- /* Check if the URL starts with http:// or https:// */ -}} -{{- if or (hasPrefix "http://" $apiUrlClient) (hasPrefix "https://" $apiUrlClient) -}} - {{- $apiUrlClient -}} +{{- $backendApiUrl := include "keep.findBackendEnvVar" (list "KEEP_API_URL" .) -}} +{{- if $backendApiUrl -}} + {{- $backendApiUrl -}} {{- else -}} - {{- include "keep.fullUrl" . -}}{{- $apiUrlClient -}} + {{- $apiUrlClient := include "keep.apiUrlClient" . -}} + {{- /* Check if the URL starts with http:// or https:// */ -}} + {{- if or (hasPrefix "http://" $apiUrlClient) (hasPrefix "https://" $apiUrlClient) -}} + {{- $apiUrlClient -}} + {{- else -}} + {{- include "keep.fullUrl" . -}}{{- $apiUrlClient -}} + {{- end -}} {{- end -}} {{- end -}}