diff --git a/nexus/db-queries/src/db/datastore/vpc.rs b/nexus/db-queries/src/db/datastore/vpc.rs index 988f40e770..89ee1c468e 100644 --- a/nexus/db-queries/src/db/datastore/vpc.rs +++ b/nexus/db-queries/src/db/datastore/vpc.rs @@ -2482,7 +2482,7 @@ mod tests { .await; // Add another, and get another route. - let (_, sub1) = new_subnet_ez( + let (authz_sub1, sub1) = new_subnet_ez( &opctx, &datastore, &db_vpc, @@ -2536,6 +2536,50 @@ mod tests { ) .await; + // If we use a reserved name, we should be able to update the table. + let sub1 = datastore + .vpc_update_subnet( + &opctx, + &authz_sub1, + VpcSubnetUpdate { + name: Some( + "default-v4".parse::().unwrap().into(), + ), + description: None, + time_modified: Utc::now(), + }, + ) + .await + .unwrap(); + + verify_all_subnet_routes_in_router( + &opctx, + &datastore, + db_router.id(), + &[&sub1], + ) + .await; + + // Ditto for adding such a route. + let (_, sub0) = new_subnet_ez( + &opctx, + &datastore, + &db_vpc, + &authz_vpc, + "default-v6", + [172, 30, 0, 0], + 22, + ) + .await; + + verify_all_subnet_routes_in_router( + &opctx, + &datastore, + db_router.id(), + &[&sub0, &sub1], + ) + .await; + db.cleanup().await.unwrap(); logctx.cleanup_successful(); } diff --git a/schema/crdb/vpc-subnet-routing/up03.sql b/schema/crdb/vpc-subnet-routing/up03.sql index 7c4cc97a80..fb4fd2324a 100644 --- a/schema/crdb/vpc-subnet-routing/up03.sql +++ b/schema/crdb/vpc-subnet-routing/up03.sql @@ -54,7 +54,7 @@ SELECT gen_random_uuid(), vpc_subnet.name, 'VPC Subnet route for ''' || vpc_subnet.name || '''', now(), now(), - omicron.public.vpc_router.id, 'default', + omicron.public.vpc_router.id, 'vpc_subnet', 'subnet:' || vpc_subnet.name, 'subnet:' || vpc_subnet.name FROM (omicron.public.vpc_subnet JOIN omicron.public.vpc