oxidecomputer / oxidecomputer/oxide.rs

`instance nic update` panics if invalid IpNet is supplied in json-body

Open
#1,013 2 comments 0 reactions 1 assignee View on GitHub

@ahl is already working on this.

Since Feb 13, 2025.

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

Description

Component
  • CLI
  • SDK
  • Something else
  • Not sure
What was the expected behaviour

An error, not a panic... i.e. don't call unwrap()

What is the current behaviour and what actions did you take to get there
treyaspelund@Tallon-IV 11:08:13 AM | ~/Downloads
‣ ./oxide --profile sandbox instance nic update --interface cba51266-68a8-4f86-a57d-e06a501f6020 --json-body transit_ips_invalid.json
thread 'tokio-runtime-worker' panicked at cli/src/generated_cli.rs:9658:90:
called `Result::unwrap()` on an `Err` value: Error("data did not match any variant of untagged enum IpNet", line: 2, column: 83)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at cli/src/main.rs:107:10:
called `Result::unwrap()` on an `Err` value: JoinError::Panic(Id(9), "called `Result::unwrap()` on an `Err` value: Error(\"data did not match any variant of untagged enum IpNet\", line: 2, column: 83)", ...)

✕ treyaspelund@Tallon-IV 11:08:48 AM | ~/Downloads
‣ cat transit_ips_invalid.json
{
  "transit_ips": ["127.0.0.8/32", "100.64.1.1/24", "224.0.0.44/26", "400.0.0.0/32"]
}
CLI or SDK version

0.8.0+20241009.0

Operating system

MacOS Sonoma 14.5

Anything else you would like to add?
✕ treyaspelund@Tallon-IV 11:09:58 AM | ~/Downloads
‣ ./oxide version
Oxide CLI 0.8.0+20241009.0
Built from commit: 1aa4b473a0514f8a388b10ad249033264cba298c
Oxide API: 20241009.0

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.