Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use more PhysicalDiskUuid #7163

Merged
merged 3 commits into from
Nov 26, 2024
Merged

Conversation

jmpesp
Copy link
Contributor

@jmpesp jmpesp commented Nov 25, 2024

No description provided.

@@ -208,8 +209,10 @@ impl super::Nexus {
opctx: &'a OpContext,
disk_selector: &params::PhysicalDiskPath,
) -> Result<lookup::PhysicalDisk<'a>, Error> {
Ok(lookup::LookupPath::new(&opctx, &self.db_datastore)
.physical_disk(disk_selector.disk_id))
// XXX how to do typed UUID as part of dropshot path?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one thing I didn't know how to do, or if dropshot even supported it. Comments welcome :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should just work if you change the type of params::PhysicalDiskPath::disk_id to be PhysicalDiskUuid instead of Uuid. However, I'm not sure we want to: this would affect the public API and would "leak" our typed UUIDs:

--- a/openapi/nexus.json
+++ b/openapi/nexus.json
@@ -4786,8 +4786,7 @@
             "description": "ID of the physical disk",
             "required": true,
             "schema": {
-              "type": "string",
-              "format": "uuid"
+              "$ref": "#/components/schemas/TypedUuidForPhysicalDiskKind"
             }
           }
         ],
@@ -22499,6 +22498,10 @@
           "ram_provisioned"
         ]
       },
+      "TypedUuidForPhysicalDiskKind": {
+        "type": "string",
+        "format": "uuid"
+      },
       "NameSortMode": {
         "description": "Supported set of sort modes for scanning by name only\n\nCurrently, we only support scanning in ascending order.",
         "oneOf": [

I vaguely remember @ahl suggesting this wasn't something we wanted, but can't find the details of that suggestion at the moment. Maybe this doesn't translate particularly well for non-Rust OpenAPI clients?

@jmpesp
Copy link
Contributor Author

jmpesp commented Nov 26, 2024

6892	2024-11-26T00:42:40.742Z	        FAIL [   0.390s] omicron-sled-agent rack_setup::plan::service::tests::test_rss_service_plan_v5_schema
6893	2024-11-26T00:42:40.742Z	        FAIL [   0.457s] sled-storage manager::test::test_omicron_physical_disks_schema

looking into it now

@jmpesp jmpesp merged commit 56261b2 into oxidecomputer:main Nov 26, 2024
17 checks passed
@jmpesp jmpesp deleted the more_physical_disk_uuid branch November 26, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants