Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Sources/ContainerCommands/Network/NetworkCreate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions docs/command-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ container network create NAME [OPTIONS]
**Options**

* `--label <key=value>`: set metadata labels on the network
* `--subnet <value>`: set subnet on the network
* **Global**: `--version`, `-h`/`--help`

### `container network delete (rm)`
Expand Down