linode-cli icon indicating copy to clipboard operation
linode-cli copied to clipboard

Fix support for deeply nested oneOfs; group nested oneOf options on help pages

Open lgarber-akamai opened this issue 11 months ago • 0 comments

📝 Description

This pull request resolves a regression that occurred in v5.58.0 alongside the Linode Interfaces release, where the arguments used to specify nested config interface arguments (e.g. --interfaces.purpose) disappeared. This was partially the result of an issue with the spec and partially an issue with how the CLI parses nested oneOfs.

NOTE: This PR will be marked as do-not-merge until the corresponding change has been released in the OpenAPI spec.

NOTE: Because the CLI does not currently support rendering options on nested fields on help pages, the help page ouput is a bit difficult to parse. We should resolve this in a follow-up ticket.

✔️ How to Test

The following test steps assume you have pulled down this PR locally and run the following:

# Installing the CLI using a patched spec since the change hasn't yet been released
make install SPEC=https://gist.githubusercontent.com/lgarber-akamai/90ca1fb91b901e4f9b0de0550c13d83f/raw/2133d538be913c8c900fd49d7fb393f7e30eb9ec/openapi.json

Integration Testing

make test-int

Unit Testing

make test-unit

Manual Testing

  1. Run the following command to create a VPC and subnet:
linode-cli vpcs create --json \
  --label test-vpc \
  --region us-mia \
  --subnets.label my-subnet \
  --subnets.ipv4 '10.0.0.0/24'
  1. Run the following command to create an instance with a complex VPC and public interface configuration. Be sure to replace MY_SUBNET_ID with the ID of the subnet created above:
linode-cli linodes create \
  --type g6-nanode-1 --region us-mia \
  --image linode/ubuntu24.04 \
  --root_pass 'myp4ssw0rd!!!1!!11!!!11!!!!' \
  --interfaces.purpose vpc \
  --interfaces.primary true \
  --interfaces.subnet_id MY_SUBNET_ID \
  --interfaces.ipv4.nat_1_1 any \
  --interfaces.ipv4.vpc '10.0.0.5' \
  --interfaces.ip_ranges '["10.0.0.6/32"]' \
  --interfaces.purpose public
  1. Ensure the instance with the given interface configuration was created successfully.

lgarber-akamai avatar Jun 09 '25 20:06 lgarber-akamai