@@ -195,7 +195,12 @@ jobs:
195195
196196 - name : Assert gateway subchart renders under the umbrella
197197 run : |
198- if ! grep -q "app.kubernetes.io/name: gateway" /tmp/umbrella.yaml; then
198+ # Assert on the Source marker helm stamps on every rendered file, not on
199+ # the gateway's pod label: sibling charts legitimately SELECT that label
200+ # (langyagent's NetworkPolicy has an egress rule to the gateway), so a
201+ # label grep answers "does anything mention the gateway", not "did the
202+ # subchart render".
203+ if ! grep -q "^# Source: langwatch/charts/gateway/" /tmp/umbrella.yaml; then
199204 echo "umbrella chart did NOT include the gateway subchart — dependency broken?"
200205 exit 1
201206 fi
@@ -204,14 +209,50 @@ jobs:
204209 exit 1
205210 fi
206211
212+ - name : Assert the gateway follows the release name to the control plane
213+ working-directory : charts/langwatch
214+ run : |
215+ # A fixed control-plane address resolves only on an install named the
216+ # same as ours, and the failure is silent: every pod healthy, then
217+ # every virtual-key request refused. Render under a release name that
218+ # is deliberately NOT "langwatch" so a hardcoded default cannot pass.
219+ helm template lw . --set autogen.enabled=true --dry-run > /tmp/umbrella-lw.yaml
220+ if ! grep -q 'LW_GATEWAY_BASE_URL: "http://lw-app:5560"' /tmp/umbrella-lw.yaml; then
221+ echo "gateway control-plane URL does not follow the release name:"
222+ grep "LW_GATEWAY_BASE_URL" /tmp/umbrella-lw.yaml || echo " (not rendered at all)"
223+ exit 1
224+ fi
225+
226+ # An address the operator set is theirs, not a starting point.
227+ helm template lw . --set autogen.enabled=true \
228+ --set gateway.controlPlane.baseUrl=http://elsewhere.internal:9000 --dry-run \
229+ > /tmp/umbrella-cp-override.yaml
230+ if ! grep -q 'LW_GATEWAY_BASE_URL: "http://elsewhere.internal:9000"' /tmp/umbrella-cp-override.yaml; then
231+ echo "an explicit gateway.controlPlane.baseUrl was overridden by the derived one"
232+ exit 1
233+ fi
234+
235+ # The derivation can only assume the default app port, so an app moved
236+ # off it has to be refused rather than silently dialled.
237+ if helm template lw . --set autogen.enabled=true --set app.service.port=8080 --dry-run \
238+ > /tmp/umbrella-cp-port.yaml 2>&1; then
239+ echo "a non-default app.service.port with no gateway.controlPlane.baseUrl should fail to render"
240+ exit 1
241+ fi
242+ if ! grep -q "gateway.controlPlane.baseUrl" /tmp/umbrella-cp-port.yaml; then
243+ echo "the refusal does not name the value that fixes it:"
244+ cat /tmp/umbrella-cp-port.yaml
245+ exit 1
246+ fi
247+
207248 - name : helm template (umbrella gateway disabled)
208249 working-directory : charts/langwatch
209250 run : |
210251 helm template langwatch . --set autogen.enabled=true --set gateway.chartManaged=false --dry-run > /tmp/umbrella-no-gw.yaml
211252
212253 - name : Assert opt-out drops the gateway
213254 run : |
214- if grep -q "app.kubernetes.io/name: gateway" /tmp/umbrella-no-gw.yaml; then
255+ if grep -q "^# Source: langwatch/charts/ gateway/ " /tmp/umbrella-no-gw.yaml; then
215256 echo "gateway.chartManaged=false should suppress the subchart"
216257 exit 1
217258 fi
0 commit comments