fix(driver-vm): resolve lifecycle requests on sandbox_id alone - #3305
fix(driver-vm): resolve lifecycle requests on sandbox_id alone#3305letv1nnn wants to merge 1 commit into
Conversation
Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
|
Is this unique to the vm driver or are others already using ID? I thought we were standardizing on workspace+sandbox_name for sandbox management. @drew can you weigh in? |
|
hey @johntmyers, this is not unique to vm driver, docker (#3240) and mxc (#3278) drivers had the same weakness and got the same fix: |
|
We have this ticket #3050 to standardize how we reference sandboxes across the product. Lets prefer that ticket and associated pr. We should try and prefer workspace+name rather than id I think. |
|
Thanks @drew, I read through #3272. My understanding is that it standardizes the public gateway RPCs on workspace + name while keeping sandbox IDs internal at the compute-driver boundary, and it doesn't touch Two options, happy with either:
I'd lean toward 1 now and 2 as the follow-up, mainly so docker/vm/mxc don't sit in three different states while #3050 is in flight. |
Summary
stop_sandbox,start_sandbox, anddelete_sandboxon the VM driver preferred the suppliedsandbox_idbut fell back to matching onsandbox_namewhenever that id was absent from the registry. Because sandbox names are unique per workspace rather than globally, that fallback could resolve to a same-named sandbox in a different workspace. Lifecycle resolution now treats a supplied id as authoritative.Related Issue
Fixes #3254
Changes
stop_sandbox,start_sandbox, anddelete_sandboxselect the resolution branch on whether the caller supplied asandbox_id, not on whether that id happened to be present. A supplied id resolves on its own or reports absence.resolve_record_idhelper, replacing the same logic copy-pasted across the three methods.FailedPreconditioninstead of resolving byHashMapiteration order.insert_named_recordsets a record's id, name, and workspace independently.get_sandboxis unchanged: it already gates its name fallback onsandbox_id.is_empty(), and it is read-only.Testing
mise run pre-commitpassesChecklist