Skip to content

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

Description

@RedZapdos123

Description:

While checking the broader resource reference annotation gaps tracked in #379, I found two additional straightforward misses in storage/frontend_virtio_scsi.proto.

These fields represent other resources, but they do not currently declare (google.api.resource_reference).type:

  • storage/frontend_virtio_scsi.proto:190 - VirtioScsiLun.target_name_ref
  • storage/frontend_virtio_scsi.proto:421 - StatsVirtioScsiLunRequest.controller_name_ref

Why this is an issue:

The same file already uses explicit resource reference typing for related fields, for example:

  • CreateVirtioScsiLunRequest.parent uses child_type = "opi_api.storage.v1/VirtioScsiTarget"
  • DeleteVirtioScsiLunRequest.name uses type = "opi_api.storage.v1/VirtioScsiLun"
  • CreateVirtioScsiTargetRequest.parent uses child_type = "opi_api.storage.v1/VirtioScsiController"

So these two fields stand out as inconsistent with the rest of the schema and with AIP-122 guidance for fields that reference another resource.

Expected fix:

Add the missing resource reference annotations:

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

Issue inspection:

Inspect storage/frontend_virtio_scsi.proto and compare:

  • line 190: string target_name_ref = 2 [(google.api.field_behavior) = REQUIRED];
  • line 421: string controller_name_ref = 2 [(google.api.field_behavior) = OPTIONAL];

against nearby fields in the same file that already include (google.api.resource_reference) metadata.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions