Add --labels for networks. (#600)

- Closes #557.
- Breaking change: removes `.upToNextOption` for labels on volumes as
this is not what is done for containers, and it forces the argument to
precede the options if a label is supplied, which is non-intuitive.

## Type of Change
- [ ] Bug fix
- [x] New feature  
- [x] Breaking change
- [x] Documentation update

## Motivation and Context
Consistent features and UX across managed resources.

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [x] Added/updated docs
This commit is contained in:
J Logan
2025-09-15 11:27:51 -07:00
committed by GitHub
parent 9692d79040
commit a54be363f7
13 changed files with 316 additions and 30 deletions
+7 -4
View File
@@ -465,10 +465,13 @@ Creates a new network with the given name.
**Usage**
```bash
container network create NAME
container network create NAME [OPTIONS]
```
No additional flags; uses global options for debugging, version, and help.
**Options**
* `--label <key=value>`: set metadata labels on the network
* **Global**: `--version`, `-h`/`--help`
### `container network delete (rm)`
@@ -530,8 +533,8 @@ container volume create [OPTIONS] NAME
**Options**
* `-s <size>`: size of the volume (default: 512GB). Examples: `1G`, `512MB`, `2T`
* `--opt <key=value>`: set driver-specific options (repeatable)
* `--label <key=value>`: set metadata labels on the volume (repeatable)
* `--opt <key=value>`: set driver-specific options
* `--label <key=value>`: set metadata labels on the volume
* **Global**: `--version`, `-h`/`--help`
### `container volume delete (rm)`