Skip to content

fix(up): drop unsupported network aliases instead of failing startup#133

Merged
Cyb3rDudu merged 1 commit into
mainfrom
fix/network-alias-probe
Jul 12, 2026
Merged

fix(up): drop unsupported network aliases instead of failing startup#133
Cyb3rDudu merged 1 commit into
mainfrom
fix/network-alias-probe

Conversation

@Cyb3rDudu

Copy link
Copy Markdown
Collaborator

Fixes #130.

Problem

Since #119, every service attached to a custom network fails to start on Apple Container 1.x:

Error: unknown network property 'alias'. Available properties: mac, mtu

container run only accepts the mac and mtu network properties.

Root cause

supportsNetworkAliases() probed container-compose's own ArgumentParser model (Application.ContainerRun.parse), which accepts any key=value — so it always reported true. networkRunArg then emitted alias=<service> unconditionally (even with no user-defined aliases), which the daemon rejects.

Verified directly against the daemon:

  • container run --network "appnet,alias=web" → exit 1 (error above)
  • container run --network appnet → works

Fix

Verification

Smoke-tested a 2-service compose (service with aliases: [webby, frontend] on a custom network):

  • Before: web failed to start with the alias error.
  • After: both services start; warning fires only for the service with user aliases; ping web still resolves via /etc/hosts.
  • Unit tests updated (networkAliasesWarnWhenUnsupported) + new networkAliasesNoWarningWithoutUserAliases; existing networkAliasesDoNotDuplicateServiceName still green.

Apple Container's `container run` only accepts the `mac` and `mtu` network
properties and rejects `alias` ("unknown network property 'alias'"), so
every service attached to a custom network failed to start.

The capability probe tested container-compose's own ArgumentParser model
(Application.ContainerRun.parse), which accepts any `key=value`, so it
always reported support. networkRunArg then emitted `alias=<service>`
unconditionally — breaking the core container + network case.

Replace the probe with an honest false (no Apple Container version supports
aliases today) and only warn when the user explicitly declared aliases;
the implicit service-name alias is covered by the /etc/hosts fallback, so
warning about it on every networked service was just noise.

Fixes #130
@Cyb3rDudu Cyb3rDudu merged commit 40f0b33 into main Jul 12, 2026
1 check passed
@Cyb3rDudu Cyb3rDudu deleted the fix/network-alias-probe branch July 12, 2026 17:23
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.

Services on custom networks fail to start (network alias probe false-positive)

1 participant