Skip to content

feat: support the service hostname key#8

Merged
lesnik512 merged 5 commits into
mainfrom
feat/service-hostname
Jul 8, 2026
Merged

feat: support the service hostname key#8
lesnik512 merged 5 commits into
mainfrom
feat/service-hostname

Conversation

@lesnik512

Copy link
Copy Markdown
Member

What

Accept the Compose service hostname key. Previously compose2pod rejected it
(service '<name>': unsupported key 'hostname'), which broke real CI compose
files that set a hostname (e.g. keydb: hostname: keydb-test-server-0) and
connect to the service by that name.

The hostname is folded into graph.hostnames(), so it becomes an
--add-host <hostname>:127.0.0.1 entry - resolvable to loopback in the pod's
shared network namespace, exactly like a network alias already is. No
per-container --hostname is emitted (pod members share the UTS namespace).

Why

The rejected name is load-bearing: the application connects to the service at
that hostname, so silently dropping it would emit a script that fails at
connect time. Full rationale, alternatives, and non-goals live in the change
file - this body does not restate them:

  • Design/spec: planning/changes/2026-07-08.01-service-hostname.md
  • Capability doc updated in this PR: architecture/supported-subset.md

Tests

just test-ci - 86 passed, 100% line coverage. just lint-ci clean. Coverage
at all three layers: validate acceptance (test_parsing.py), hostname
collection (test_graph.py, incl. empty-hostname guard), and end-to-end
validate -> emit_script rendering the --add-host entry (test_emit.py).

@lesnik512 lesnik512 merged commit 3e30963 into main Jul 8, 2026
6 checks passed
@lesnik512 lesnik512 deleted the feat/service-hostname branch July 8, 2026 14:12
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