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
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- **Full image-property support across `image create`, `image update` and
`image show`.** Custom Glance properties (`os_distro`, `os_version`,
`hw_qemu_guest_agent`, `cinder_img_volume_type`, …) can now be set on
creation (`--property KEY=VALUE`, repeatable) and edited atomically on
existing images (`--property` and `--remove-property`, `--ignore-missing`
for idempotent removal). Property keys are validated client-side against
Glance's `^[A-Za-z0-9_:.\-]{1,255}$` schema before any HTTP round-trip,
and only the first `=` splits the value so URL-like values survive intact
(`--property url=https://x?a=1&b=2`). `image show` surfaces every custom
key Glance returns plus the integrity fields (`checksum`, `os_hash_algo`,
`os_hash_value`, `direct_url`, `tags`): as a `Properties` sub-table in
table format, under a new top-level `"properties"` aggregate in JSON
(with each custom key **also** mirrored at the JSON root for backward
compatibility — `jq .os_distro` keeps working alongside the new
`jq .properties.os_distro`), and as `KEY VALUE` lines in value format.
This unblocks lossless inter-cloud image migration.

### Fixed

- **Shell completion install no longer slows shell startup.** The
Expand Down
48 changes: 43 additions & 5 deletions docs/commands/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ orca image cache-queue [OPTIONS]
Create a new image (and optionally upload data).

```bash
orca image create [OPTIONS]
orca image create [OPTIONS] NAME
```

| Option | Description |
Expand All @@ -82,8 +82,16 @@ orca image create [OPTIONS]
| `--min-ram INTEGER` | Min RAM (MB). [default: 0] |
| `--visibility [private|shared|community|public]` | |
| `--file PATH` | Upload image data from file immediately. |
| `--property KEY=VALUE` | Custom image property to set on creation (repeatable). Values may contain `=` — only the first `=` splits. Keys must match `^[A-Za-z0-9_:.\-]{1,255}$`. |
| `--help` | Show this message and exit. |

```bash
orca image create ubuntu-24.04 --file ubuntu.qcow2 \
--property os_distro=ubuntu \
--property os_version=24.04 \
--property hw_qemu_guest_agent=yes
```

---

## deactivate
Expand Down Expand Up @@ -276,18 +284,33 @@ orca image share-and-accept [OPTIONS]

## show

Show image details.
Show image details, including custom properties and integrity hashes.

```bash
orca image show [OPTIONS]
orca image show [OPTIONS] IMAGE_ID
```

Custom properties (anything outside the Glance v2 standard schema, e.g.
`os_distro`, `os_version`, `hw_qemu_guest_agent`, `cinder_img_volume_type`)
are surfaced separately:

- **table** — rendered as a `Properties` sub-table after the main table,
sorted by key.
- **json** — exposed both at the top level (mirroring the raw Glance
response shape, so existing scripts using `jq .os_distro` keep working)
and under a new top-level `"properties"` aggregate so callers can also
do `orca image show <id> -f json | jq .properties`.
- **value** — printed after the standard fields, one `KEY VALUE` per line.

Integrity fields (`checksum`, `os_hash_algo`, `os_hash_value`, `direct_url`)
and `tags` are always included as standard fields when Glance returns them.

| Option | Description |
|--------|-------------|
| `--noindent` | Disable JSON indentation. |
| `--max-width INTEGER` | Maximum table width (0 = unlimited). |
| `--fit-width` | Fit table to terminal width. |
| `-c, --column TEXT` | Column to include (repeatable). Shows all if |
| `-c, --column TEXT` | Column to include (repeatable). Shows all if omitted. |
| `-f, --format [table|json|value]` | |
| `--help` | Show this message and exit. |

Expand Down Expand Up @@ -429,17 +452,32 @@ orca image unused [OPTIONS]
Update image properties (JSON-Patch).

```bash
orca image update [OPTIONS]
orca image update [OPTIONS] IMAGE_ID
```

All flags compose into a single atomic JSON-Patch document.
`--property` emits `add` when the key is absent on the image and `replace` when
it already exists, so untouched properties survive. `--remove-property` is
strict by default (errors if the key is absent) and turns idempotent under
`--ignore-missing`.

| Option | Description |
|--------|-------------|
| `--name TEXT` | New name. |
| `--min-disk INTEGER` | New min disk (GB). |
| `--min-ram INTEGER` | New min RAM (MB). |
| `--visibility [private|shared|community|public]` | |
| `--property KEY=VALUE` | Set or replace a custom image property. Repeatable. |
| `--remove-property KEY` | Remove a custom image property by key. Repeatable. |
| `--ignore-missing` | With `--remove-property`: silently skip keys that are not present on the image. |
| `--help` | Show this message and exit. |

```bash
orca image update <id> --property os_distro=ubuntu --property os_version=24.04
orca image update <id> --remove-property hw_qemu_guest_agent
orca image update <id> --remove-property foo --ignore-missing
```

---

## upload
Expand Down
Loading
Loading