Skip to content

Commit

Permalink
fix: adjust keep api url
Browse files Browse the repository at this point in the history
  • Loading branch information
shahargl committed Dec 31, 2024
1 parent f4e81e0 commit 83c1461
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
4 changes: 2 additions & 2 deletions charts/keep/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
31 changes: 26 additions & 5 deletions charts/keep/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*/}}
Expand Down Expand Up @@ -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 -}}

0 comments on commit 83c1461

Please sign in to comment.