Skip to content

fix: respect SERVICEKIT_HOST env var in service registration#10

Merged
mortenoh merged 5 commits intomainfrom
fix/servicekit-host-env-var
Apr 8, 2026
Merged

fix: respect SERVICEKIT_HOST env var in service registration#10
mortenoh merged 5 commits intomainfrom
fix/servicekit-host-env-var

Conversation

@mortenoh
Copy link
Copy Markdown
Contributor

@mortenoh mortenoh commented Apr 8, 2026

Summary

  • Fixed host resolution order in service registration from parameter -> auto-detect -> env var to parameter -> env var -> auto-detect
  • socket.gethostname() almost always succeeds, so the env var was effectively dead code
  • Now matches how SERVICEKIT_PORT resolution already works
  • Version bump to 0.8.2

Context

When chap-core runs in Docker and a servicekit service runs on the host, the auto-detected hostname (e.g. mlaptop.local) is not resolvable from inside Docker. Setting SERVICEKIT_HOST=host.docker.internal had no effect.

Test plan

  • All existing tests pass (370 passed)
  • Linting passes

mortenoh added 4 commits April 8, 2026 17:00
The host resolution order was parameter -> auto-detect -> env var,
meaning socket.gethostname() always succeeded first and the env var
was never consulted. Changed to parameter -> env var -> auto-detect,
matching how SERVICEKIT_PORT resolution already works.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mortenoh mortenoh merged commit 57d331a into main Apr 8, 2026
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.

1 participant