oxidecomputer / oxidecomputer/oxide.rs

`from-image`: can't specify silo image by name

Open
#411 4 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

The code assumes that an image specified by name is a project image.

https://github.com/oxidecomputer/oxide.rs/blob/77a04019aa1ac794b28b2bfa158eb318b2d5a0fc/cli/src/cmd_instance.rs#L247-L251

I see two ways around this, neither great. I think I prefer the second.

  • Add a way of indicating when you want a silo image by name
    • Instead of --image maybe have mutually exclusive --project-image and --silo-image flags?
    • I considered --image + --image-project but a) that project will always be the same as the --project project when specified, b) confusing name
  • Avoid the problem by only allowing specifying an image by ID, which is pretty easily conveyed by the help text and the argument name. You could call it --image-id, that would be pretty unambiguous. That requires the user to use oxide image view view get the ID first.

Of course, by taking out half of what this command does for you, option 2 pushes us more in the direction of getting rid of it altogether.

Yeah... I'm even more of the opinion that hand-rolled subcommands such as this one may be a step in the wrong direction.

https://github.com/oxidecomputer/oxide.rs/issues/373#issuecomment-1734554026

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 with cli/src/cmd_instance.rs lines 247-251 and the linked discussion in issue #373. Compare the proposed handling for project and silo image names with the alternative of accepting only an image ID. Done requires an agreed command interface and behavior for selecting or identifying silo images.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.