feat: set DM_BASE_PATH so the viz-app serves under its Ingress sub-path#9
Merged
Conversation
The viz-app is exposed by the Ingress at a per-instance sub-path
('/<instance-id>') but, served from '/', its assets, client-side routes
and API calls resolved at the origin root and rendered a blank page.
squonk2-viz-app now honours DM_BASE_PATH (see squonk2-viz-app#7), so set
it to '/<instance-id>' whenever an instance id is known; omit it
otherwise (the app then serves at '/' as before). No Ingress change is
needed - it already routes the sub-path to the Pod.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When a
DataVisualisationis deployed, the Ingress exposes the viz-app at aper-instance sub-path (
/<instance-id>). The app was served from/, so itsassets, client-side routes and
/api/...calls resolved at the origin root— which the path-based Ingress does not route to the Pod — and the page
rendered blank.
squonk2-viz-appnow supports aDM_BASE_PATHenv var(InformaticsMatters/squonk2-viz-app#7). This change has the operator set it.
Change
build_environmentappendsDM_BASE_PATH = "/<instance-id>"whenever aninstance id is known, and omits it otherwise (the app then serves at
/, asbefore). The Ingress is unchanged — it already routes the
/<name>sub-path tothe Pod.
Tests (TDD — written first, seen red before the change)
test_build_environment_sets_dm_base_path_from_instance_id→/instance-111test_build_environment_omits_dm_base_path_when_instance_id_absent→ key absentAll 33 tests pass;
blackclean;pylint10/10. (The pre-existing mypy-strictcomplaint on the
@kopf.on.createdecorator is unrelated and present onmain.)Note
DM_BASE_PATHmust match the URL prefix the Ingress serves (/<name>). Thisrelies on the CR
nameequalling the…/instance-idlabel value — confirmed asthe case for this deployment. Worth an end-to-end check on a real cluster once
the viz-app fix is released, since this is the first time both halves run
together.
🤖 Generated with Claude Code