Skip to content

VPC and subnet name should be required in NIC create form #993

Description

@david-crespo

Bug noticed while reviewing #985 but not actually introduced by that PR.

These lines in the mock NIC create endpoint (which were already there) mean that any NIC create without a VPC name and a subnet name will 404.

const [vpc, vpcErr] = lookupVpc({ ...req.params, vpcName: vpc_name })
if (vpcErr) return res(vpcErr)
const [subnet, subnetErr] = lookupVpcSubnet({
...req.params,
vpcName: vpc_name,
subnetName: subnet_name,
})
if (subnetErr) return res(subnetErr)

Turns out these are not actually optional on the POST, which is a relief because I did not understand how that would work. So those fields should be marked required in the create form.

https://github.com/oxidecomputer/omicron/blob/a0e5d59a3190b40138c5d6928f6cb89aebb00e9b/nexus/src/external_api/params.rs#L275-L287

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions