Skip to content

fix(storage): add missing VirtioScsi resource_reference types#490

Open
RedZapdos123 wants to merge 1 commit into
opiproject:mainfrom
RedZapdos123:fix/virtio-scsi-resource-refs-489
Open

fix(storage): add missing VirtioScsi resource_reference types#490
RedZapdos123 wants to merge 1 commit into
opiproject:mainfrom
RedZapdos123:fix/virtio-scsi-resource-refs-489

Conversation

@RedZapdos123

@RedZapdos123 RedZapdos123 commented Jun 24, 2026

Copy link
Copy Markdown

Description:

Issue #489 reported that two Virtio SCSI resource reference fields were missing explicit google.api.resource_reference typing.

VirtioScsiLun.target_name_ref and StatsVirtioScsiLunRequest.controller_name_ref referenced other storage resources, but unlike nearby fields in the same proto they only declared field behavior. That left the schema inconsistent and omitted the concrete target resource metadata expected for resource-reference fields.

This PR adds the missing resource reference annotations:

  • target_name_ref -> opi_api.storage.v1/VirtioScsiTarget
  • controller_name_ref -> opi_api.storage.v1/VirtioScsiController

It also refreshes the checked-in generated Go and Python descriptor bindings for frontend_virtio_scsi.proto, so the committed SDK artifacts now carry the same metadata as the source schema.

Closes #489.

Checklist:

  • I added the missing resource reference annotations in the source proto.
  • I refreshed the checked-in generated Go and Python descriptor bindings for frontend_virtio_scsi.proto.
  • I ran focused Buf linting in WSL using buf lint --path storage/frontend_virtio_scsi.proto.
  • I ran focused api-linter checks against Buf-built descriptor sets for both main and this PR version of storage/frontend_virtio_scsi.proto.
  • The focused api-linter result is unchanged by this PR: both before and after report only the same pre-existing core::0191::proto-package finding.

Why the generated diff is large:

The functional change is small, but the checked-in generated files embed serialized protobuf descriptors. Adding two resource_reference options changes those descriptor blobs and their offsets, which shows up as a large textual diff in generated Go/Python output.

Before the fix:

string target_name_ref = 2 [(google.api.field_behavior) = REQUIRED];
string controller_name_ref = 2 [(google.api.field_behavior) = OPTIONAL];

These fields had no explicit target resource typing.

After the fix:

string target_name_ref = 2 [
  (google.api.field_behavior) = REQUIRED,
  (google.api.resource_reference).type = "opi_api.storage.v1/VirtioScsiTarget"
];

string controller_name_ref = 2 [
  (google.api.field_behavior) = OPTIONAL,
  (google.api.resource_reference).type = "opi_api.storage.v1/VirtioScsiController"
];

The source schema and checked-in generated descriptors now carry the correct resource reference metadata.

@RedZapdos123 RedZapdos123 requested a review from a team as a code owner June 24, 2026 09:09
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
@RedZapdos123 RedZapdos123 force-pushed the fix/virtio-scsi-resource-refs-489 branch from 3380361 to bcf6532 Compare June 24, 2026 10:13
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.

storage/virtio-scsi: add missing resource_reference types for target_name_ref and controller_name_ref

1 participant