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
Closes #1839
Summary
This PR adds explicit network attachment aliases so a container can register additional DNS names on a network attachment.
aliasestoAttachmentOptionsandAttachmentalias=NAMEproperties in--network, for example--network backend,alias=dbRelated
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 --checkswift test -c debug -Xswiftc -warnings-as-errors --filter 'ParserTest|AttachmentAllocatorTest'swift test -c debug -Xswiftc -warnings-as-errors --filter 'DNSServerTests|AttachmentAllocatorTest|ParserTest'swift test -c debug -Xswiftc -warnings-as-errors --filter 'UtilityTests|NetworkConfigurationTest|AttachmentTest|AttachmentAllocatorTest|ParserTest'swift test -c debug -Xswiftc -warnings-as-errors --filter 'DNSServerTests|UtilityTests|NetworkConfigurationTest|AttachmentTest|AttachmentAllocatorTest|ParserTest'swift build -c debug -Xswiftc -warnings-as-errors --product container-apiserver --product containermake BUILD_CONFIGURATION=debug WARNINGS_AS_ERRORS=true container620cfc3:--install-rootand--log-rootcodex-alias-livecodex-alias-peerwith--network codex-alias-live,alias=db,alias=databasenslookup db,nslookup database, andnslookup codex-alias-peerall resolved through192.168.65.1:53to the peer container IPalias=dbfailed as expected withhostname(s) already exist: ["db"]/usr/localrelease service and verified it reports release buildee848e3with all helpers under/usr/local