Skip to content

fix: report application URL at status.viz.url for the Data Manager#10

Merged
alanbchristie merged 1 commit into
mainfrom
abc-fix-application-url-status-location
Jun 9, 2026
Merged

fix: report application URL at status.viz.url for the Data Manager#10
alanbchristie merged 1 commit into
mainfrom
abc-fix-application-url-status-location

Conversation

@claude-im

Copy link
Copy Markdown
Collaborator

Problem

The operator was not reporting the application URL back to the Data Manager (DM) within its grace period.

The CRD carries the annotation:

data-manager.informaticsmatters.com/application-url-location: viz.url

That value is a status-relative dotted path, so the DM reads the URL from status['viz']['url'].

The create handler is registered with id="viz", which makes kopf nest the entire return value under status.viz. The handler returned {"viz": {"url": url}, ...}, so the URL actually landed at status.viz.viz.url — one level too deep. The DM only looks at status.viz.url, found nothing, and never received the URL.

(The sibling jupyter operator works because its id is jupyter, it returns {"notebook": {"url": ...}}status.jupyter.notebook.url, matching its jupyter.notebook.url annotation. The viz annotation is the shorter viz.url, so the return must not re-nest under viz.)

Fix

  • Added a pure, tested build_status() builder that returns url as a top-level key, so kopf's viz nesting + top-level url = status.viz.url, matching the annotation. Its docstring documents the contract.
  • Wired the create handler to return build_status(...) instead of the double-nested dict.

Tests (TDD)

Added three tests in tests/test_handlers.py (written first, confirmed failing, now passing):

  • test_build_status_places_url_at_the_annotated_location — walks the literal annotation path viz.url against the kopf-nested status.
  • test_build_status_does_not_double_nest_under_viz — regression guard against the status.viz.viz.url bug.
  • test_build_status_reports_instance_metadata — the remaining status fields are preserved.

50 tests pass; black, mypy (strict) and pylint are clean.

Note

The create handler runs only on the create event, so any pre-existing CR with the old double-nested status won't be re-patched — the fix applies to instances created (or recreated) once this operator image is deployed.

🤖 Generated with Claude Code

The CRD's 'application-url-location: viz.url' annotation tells the Data
Manager to read the URL from status['viz']['url']. The create handler
(id="viz") returned {"viz": {"url": url}}, which kopf nests under
status.viz, placing the URL at status.viz.viz.url - one level too deep.
The Data Manager only looks at status.viz.url, so it never saw the URL
within its grace period.

Add a tested, pure build_status() builder that returns 'url' as a
top-level key (status.viz.url) and have the create handler use it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alanbchristie
alanbchristie merged commit 3e1d580 into main Jun 9, 2026
2 checks passed
@alanbchristie
alanbchristie deleted the abc-fix-application-url-status-location branch June 9, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants