mirror of
https://github.com/apple/container.git
synced 2026-09-28 01:46:25 -04:00
Update to containerization 0.20.0. (#1027)
- Use MACAddress for Attachment and CZ interfaces. - Move data validation closer to API surface.
This commit is contained in:
@@ -61,7 +61,8 @@ public actor NetworkService: Sendable {
|
||||
}
|
||||
|
||||
let hostname = try message.hostname()
|
||||
let macAddress = message.string(key: NetworkKeys.macAddress.rawValue)
|
||||
let macAddress = try message.string(key: NetworkKeys.macAddress.rawValue)
|
||||
.map { try MACAddress($0) }
|
||||
let index = try await allocator.allocate(hostname: hostname)
|
||||
let subnet = status.ipv4Subnet
|
||||
let ip = IPv4Address(index)
|
||||
@@ -78,7 +79,7 @@ public actor NetworkService: Sendable {
|
||||
"hostname": "\(hostname)",
|
||||
"ipv4Address": "\(attachment.ipv4Address)",
|
||||
"ipv4Gateway": "\(attachment.ipv4Gateway)",
|
||||
"macAddress": "\(macAddress ?? "auto")",
|
||||
"macAddress": "\(macAddress?.description ?? "unspecified")",
|
||||
])
|
||||
let reply = message.reply()
|
||||
try reply.setAttachment(attachment)
|
||||
|
||||
Reference in New Issue
Block a user