fix(up): drop unsupported network aliases instead of failing startup#133
Merged
Conversation
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
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.
Fixes #130.
Problem
Since #119, every service attached to a custom network fails to start on Apple Container 1.x:
container runonly accepts themacandmtunetwork properties.Root cause
supportsNetworkAliases()probed container-compose's ownArgumentParsermodel (Application.ContainerRun.parse), which accepts anykey=value— so it always reportedtrue.networkRunArgthen emittedalias=<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→ worksFix
false— no Apple Container version supports aliases today./etc/hostsfallback (feat(up): use Apple container DNS when domain registered, /etc/hosts fallback otherwise #97), so warning about it on every networked service was noise.Verification
Smoke-tested a 2-service compose (service with
aliases: [webby, frontend]on a custom network):ping webstill resolves via/etc/hosts.networkAliasesWarnWhenUnsupported) + newnetworkAliasesNoWarningWithoutUserAliases; existingnetworkAliasesDoNotDuplicateServiceNamestill green.