Skip to content

Commit b5881bd

Browse files
authored
fix: Update FRONTEND_URL to be dynamic w/ingress (#58)
When ingress is enabled, the FRONTEND_URL had the wrong value, causing internal links to break like team invites. This has been updated. Fixes: HDX-1901
1 parent dc95a97 commit b5881bd

File tree

3 files changed

+56
-2
lines changed

3 files changed

+56
-2
lines changed

.changeset/plenty-olives-visit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"helm-charts": patch
3+
---
4+
5+
fix: Update FRONTEND_URL to be dynamic w/ingress

charts/hdx-oss-v2/templates/configmaps/app-configmap.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ metadata:
77
data:
88
APP_PORT: {{ .Values.hyperdx.appPort | quote }}
99
API_PORT: {{ .Values.hyperdx.apiPort | quote }}
10+
{{- if .Values.hyperdx.ingress.enabled }}
11+
FRONTEND_URL: "{{ if .Values.hyperdx.ingress.tls.enabled }}https{{ else }}http{{ end }}://{{ .Values.hyperdx.ingress.host }}"
12+
{{- else }}
1013
FRONTEND_URL: "{{ .Values.hyperdx.appUrl }}:{{ .Values.hyperdx.appPort }}"
14+
{{- end }}
1115
HYPERDX_API_PORT: "{{ .Values.hyperdx.apiPort }}"
1216
HYPERDX_APP_PORT: "{{ .Values.hyperdx.appPort }}"
1317
HYPERDX_APP_URL: "{{ .Values.hyperdx.appUrl }}"

charts/hdx-oss-v2/tests/configmap_test.yaml

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ suite: Test ConfigMap
22
templates:
33
- configmaps/app-configmap.yaml
44
tests:
5-
- it: should render app configmap correctly
5+
- it: should render app configmap correctly with default values
66
set:
77
hyperdx:
88
apiPort: 8000
@@ -40,4 +40,49 @@ tests:
4040
value: "false"
4141
- matchRegex:
4242
path: data.MONGO_URI
43-
pattern: mongodb://.*-mongodb:27017/hyperdx
43+
pattern: mongodb://.*-mongodb:27017/hyperdx
44+
45+
- it: should use ingress URL for FRONTEND_URL when ingress is enabled
46+
set:
47+
hyperdx:
48+
apiPort: 8000
49+
appPort: 3000
50+
appUrl: http://localhost
51+
ingress:
52+
enabled: true
53+
host: hyperdx.example.com
54+
tls:
55+
enabled: false
56+
asserts:
57+
- equal:
58+
path: data.FRONTEND_URL
59+
value: "http://hyperdx.example.com"
60+
61+
- it: should use ingress HTTPS URL for FRONTEND_URL when TLS is enabled
62+
set:
63+
hyperdx:
64+
apiPort: 8000
65+
appPort: 3000
66+
appUrl: http://localhost
67+
ingress:
68+
enabled: true
69+
host: hyperdx.example.com
70+
tls:
71+
enabled: true
72+
asserts:
73+
- equal:
74+
path: data.FRONTEND_URL
75+
value: "https://hyperdx.example.com"
76+
77+
- it: should fallback to appUrl:port when ingress is disabled
78+
set:
79+
hyperdx:
80+
apiPort: 8000
81+
appPort: 4000
82+
appUrl: http://custom-host
83+
ingress:
84+
enabled: false
85+
asserts:
86+
- equal:
87+
path: data.FRONTEND_URL
88+
value: "http://custom-host:4000"

0 commit comments

Comments
 (0)