Skip to content

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

@taspelund

Description

@taspelund

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

Metadata

Metadata

Assignees

Labels

bugIssue relating to unexpected behaviour

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions