Skip to content

TargetDiskHints should support glob matching #36

Description

@tjjh89017

internal/diskmatch.Match compares every hint field exactly. A machine whose disk name or serial is not known in advance cannot be described.

Decided shape:

  • Every field accepts a glob, not just the device name. Serial numbers often carry a fixed vendor prefix, so a glob is useful there too.
  • When a glob matches more than one disk, sort the matches in string order and take the smallest — sd* against sda and sdb selects sda.
  • The tiebreak exists because a glob is the only way to reach more than one match. An exact hint that matched several disks would still be an error, as it is today: the controller requires exactly one match before any write.

Not scheduled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions