diff --git a/Sources/ContainerCommands/Network/NetworkCreate.swift b/Sources/ContainerCommands/Network/NetworkCreate.swift index b8e2719d..6b25e771 100644 --- a/Sources/ContainerCommands/Network/NetworkCreate.swift +++ b/Sources/ContainerCommands/Network/NetworkCreate.swift @@ -30,6 +30,9 @@ extension Application { @Option(name: .customLong("label"), help: "Set metadata for a network") var labels: [String] = [] + @Option(name: .customLong("subnet"), help: "Set subnet for a network") + var subnet: String? = nil + @OptionGroup var global: Flags.Global @@ -40,7 +43,7 @@ extension Application { public func run() async throws { let parsedLabels = Utility.parseKeyValuePairs(labels) - let config = try NetworkConfiguration(id: self.name, mode: .nat, labels: parsedLabels) + let config = try NetworkConfiguration(id: self.name, mode: .nat, subnet: subnet, labels: parsedLabels) let state = try await ClientNetwork.create(configuration: config) print(state.id) } diff --git a/docs/command-reference.md b/docs/command-reference.md index 0631c215..44cf3e39 100644 --- a/docs/command-reference.md +++ b/docs/command-reference.md @@ -527,6 +527,7 @@ container network create NAME [OPTIONS] **Options** * `--label `: set metadata labels on the network +* `--subnet `: set subnet on the network * **Global**: `--version`, `-h`/`--help` ### `container network delete (rm)`