Add network attachment aliases#1815
Conversation
89996b9 to
620cfc3
Compare
|
@thromel We won't have time to look at this in the next couple of days, but we should be able to get started on it in the next week sometime or the week after. This is exactly the CLI shape I had in mind for this. Could you create an enhancement issue for this and then add a "Closes #issue" at the top of this PR? In the issue, provide a basic description of the feature use case, UX (CLI shape), and proposed design (mainly, how does our hostname database and the interactions with it change?) Once that's in place we can have a discuss in the issue a couple other things I've had in mind relating to this capability. Thank you for taking this on. |
|
@thromel Also, please configure commit signing and verification, as we can't merge unverified commits. See: https://github.com/apple/containerization/blob/main/CONTRIBUTING.md#pull-requests |
|
Thanks, done. I filed #1839 with the use case, CLI UX, and hostname database design notes, and updated this PR body to start with I also saw the signing note. I am setting up verified SSH commit signing and will force-push signed replacement commits once GitHub recognizes the signing key. |
620cfc3 to
638ad20
Compare
9d0ae2f to
04558b5
Compare
04558b5 to
e863833
Compare
|
Fixed. I force-pushed signed replacement commits after rebasing onto current GitHub verification reports valid signatures for the current PR commits:
The PR body still starts with |
e863833 to
f8f149b
Compare
|
Rebased this PR onto the updated #1813 stack after the DNS design-doc commit. GitHub verification reports valid signatures for the current PR commits:
Focused validation after the rebase:
|
Closes #1839
Summary
This PR adds explicit network attachment aliases so a container can register additional names on a network attachment.
aliasestoAttachmentOptionsandAttachmentalias=NAMEproperties in--network, for example--network backend,alias=dbRelated
This PR registers alias names in the hostname database. Resolution from inside containers still depends on a future container-facing DNS listener design; #1813 now intentionally does not start that listener after vmnet gateway bind validation failed.
This PR is stacked and currently includes the commits from #1810 and #1813. I can rebase once those land, or split/re-target however maintainers prefer.
Notes
The CLI shape follows the existing network property syntax:
Aliases are currently validated for emptiness and normalized case/trailing-dot in the allocator, matching existing hostname lookup behavior. This keeps the change narrow and avoids introducing a stricter hostname validator than the existing primary-hostname path uses.
Testing
git diff --check origin/main..HEADswift test -c debug -Xswiftc -warnings-as-errors --filter 'ParserTest|UtilityTests|AttachmentAllocatorTest|NetworkConfigurationTest|ForwardingResolverTest|CompositeResolverTest|RecordsTests'The focused test run passed 202 tests after rebasing onto current
origin/mainand linked the CLI, APIServer, runtime, and vmnet helper as part of the package test build.