Skip to content

Commit 268c6e0

Browse files
authored
fix: Better backwards compatibility for app url (#104)
1 parent 9063916 commit 268c6e0

File tree

3 files changed

+94
-2
lines changed

3 files changed

+94
-2
lines changed

.changeset/witty-jobs-deliver.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: Better backwards compatibility for app url for existing deployments

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

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,88 @@ tests:
4141
- matchRegex:
4242
path: data.MONGO_URI
4343
pattern: mongodb://.*-mongodb:27017/hyperdx
44+
45+
- it: should use default frontendUrl template with appUrl and appPort
46+
set:
47+
hyperdx:
48+
apiPort: 8000
49+
appPort: 3000
50+
appUrl: "http://localhost"
51+
# frontendUrl should default to {{ .Values.hyperdx.appUrl }}:{{ .Values.hyperdx.appPort }}
52+
mongodb:
53+
port: 27017
54+
asserts:
55+
- equal:
56+
path: data.FRONTEND_URL
57+
value: "http://localhost:3000"
58+
59+
- it: should override frontendUrl when explicitly set
60+
set:
61+
hyperdx:
62+
apiPort: 8000
63+
appPort: 3000
64+
appUrl: "http://localhost"
65+
frontendUrl: "https://my-custom-domain.com"
66+
mongodb:
67+
port: 27017
68+
asserts:
69+
- equal:
70+
path: data.FRONTEND_URL
71+
value: "https://my-custom-domain.com"
72+
73+
- it: should support template expressions in frontendUrl
74+
set:
75+
hyperdx:
76+
apiPort: 8000
77+
appPort: 4000
78+
appUrl: "https://production-host"
79+
frontendUrl: "{{ .Values.hyperdx.appUrl }}:{{ .Values.hyperdx.appPort }}/app"
80+
mongodb:
81+
port: 27017
82+
asserts:
83+
- equal:
84+
path: data.FRONTEND_URL
85+
value: "https://production-host:4000/app"
86+
87+
- it: should handle custom appUrl and appPort in default frontendUrl
88+
set:
89+
hyperdx:
90+
apiPort: 8000
91+
appPort: 4000
92+
appUrl: "https://staging.example.com"
93+
# Using default frontendUrl template
94+
mongodb:
95+
port: 27017
96+
asserts:
97+
- equal:
98+
path: data.FRONTEND_URL
99+
value: "https://staging.example.com:4000"
100+
101+
- it: should work with ingress-style URLs in frontendUrl
102+
set:
103+
hyperdx:
104+
apiPort: 8000
105+
appPort: 3000
106+
appUrl: "http://localhost"
107+
frontendUrl: "https://hyperdx.example.com"
108+
mongodb:
109+
port: 27017
110+
asserts:
111+
- equal:
112+
path: data.FRONTEND_URL
113+
value: "https://hyperdx.example.com"
114+
115+
- it: should support complex template expressions
116+
set:
117+
hyperdx:
118+
apiPort: 8000
119+
appPort: 3000
120+
appUrl: "http://localhost"
121+
frontendUrl: "{{ if eq .Values.env \"production\" }}https://prod.example.com{{ else }}{{ .Values.hyperdx.appUrl }}:{{ .Values.hyperdx.appPort }}{{ end }}"
122+
env: "development"
123+
mongodb:
124+
port: 27017
125+
asserts:
126+
- equal:
127+
path: data.FRONTEND_URL
128+
value: "http://localhost:3000"

charts/hdx-oss-v2/values.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ hyperdx:
4343
apiPort: 8000
4444
appPort: 3000
4545
opampPort: 4320
46-
# The URL that will be use to access the frontend. Defaults to the http://localhost:appPort.
46+
# deprecated: use frontendUrl instead
47+
appUrl: "http://localhost"
48+
# The URL that will be use to access the frontend. Defaults to the http://localhost:3000.
4749
# If you have an ingress enabled, you should set this to the ingress host with the protocol. E.g. https://hdx-my-domain.com
48-
frontendUrl: http://localhost:{{ .Values.hyperdx.appPort }}
50+
frontendUrl: "{{ .Values.hyperdx.appUrl }}:{{ .Values.hyperdx.appPort }}"
4951
logLevel: "info"
5052
usageStatsEnabled: true
5153
# Endpoint to send hyperdx logs/traces/metrics to.Defaults to the chart's otel collector endpoint.

0 commit comments

Comments
 (0)