oxidecomputer / oxidecomputer/oxide.rs

Values set in CLI command get overwritten by JSON-BODY for `oxide disk create`

Open
#1,383 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
75
Forks
21
Avg merge
2d 2h
Merged PRs (30d)
19

Description

To create a disk via CLI, one must set the json-body or else we get an error message regardless of whether we set the name, size and description in the command. Furthermore, the values in the command get overwritten by the ones in the JSON file. IF we don't set those in the command, we also get an error saying we must.

If it's already necessary to provide a JSON file, and the values from it are the ones that are true, then it might be worth considering deprecating options from it so users don't get confused.

Example:
Provided everything, except the JSON file. Complained.

→ oxide disk create --name n-disk-yaml-localdisk-cli --description 'This is just for testing purposes' --size 53687091200 --project verdant --profile preview
        stderr: error: the following required arguments were not provided:
  --json-body <JSON-FILE>

Usage: oxide disk create --project <project> --json-body <JSON-FILE> --name <name> --description <description> --size <size> --profile <PROFILE>

Provided JSON file with just 'disk_backend' (because I had already filled out the rest in the command line). Complained that name, size and description were missing in the JSON file.

oxide disk create --description 'This is just for testing purposes' --json-body json/disk_create.json --name localdisk-cli --project verdant --size 53687091200 --profile preview
        stderr: failed to parse json/disk_create.json: missing field `description` at line 5 column 3

oxide disk create  [exit: 1]  (54ms)
        → oxide disk create --description 'This is just for testing purposes' --json-body json/disk_create.json --name localdisk-cli --project verdant --size 53687091200 --profile preview
        stderr: failed to parse json/disk_create.json: missing field `name` at line 6 column 3

oxide disk create --description 'This is just for testing purposes' --json-body json/disk_create.json --name localdisk-cli --project verdant --size 53687091200 --profile preview
        stderr: failed to parse json/disk_create.json: missing field `size` at line 7 column 3

Provided ONLY the JSON file. PASS.

→ oxide disk create --json-body json/disk_create.json --project verdant --profile preview
        stdout: {
  "block_size": 4096,
  "description": "localdisk-testing",
  "device_path": "/mnt/localdisk",
  "disk_type": "local",
  "id": "5507110b-296e-495d-8455-eb26c90ce7c3",
  "name": "localdisk",
  "project_id": "54b9bdc4-313e-46c9-a9bc-2328c14cc303",
  "read_only": false,
  "size": 4294967296,
  "state": {
    "state": "creating"
  },
  "time_created": "2026-03-09T23:48:27.897730Z",
  "time_modified": "2026-03-09T23:48:27.897730Z"
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the implementation of the oxide disk create CLI command and reproduce the three command examples in the issue, focusing on required arguments and JSON-body parsing. Done means command-line values no longer require duplicated JSON fields or get unexpectedly overwritten, while JSON-only creation continues to pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.