Skip to content

feat(physicaldrive): flag partitions with an IsPartition field#84

Merged
ezekiel-alexrod merged 1 commit into
mainfrom
fix/rhel8-getter-exclude-partitions-and-single-drive-force
Jul 17, 2026
Merged

feat(physicaldrive): flag partitions with an IsPartition field#84
ezekiel-alexrod merged 1 commit into
mainfrom
fix/rhel8-getter-exclude-partitions-and-single-drive-force

Conversation

@ezekiel-alexrod

@ezekiel-alexrod ezekiel-alexrod commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What

Add an IsPartition field to the PhysicalDrive entity. The RHEL8 getter sets
it (device.Type == "part"). Whole disks and partitions are both still returned
by PhysicalDrives; only the flag is new.

Why

The getter returns partition rows (lsblk TYPE=part) alongside their parent
disk. Callers previously had to re-derive partition-ness from device names to
tell them apart. The flag lets consumers distinguish partitions from whole disks
without string heuristics.

Tests

  • go test ./pkg/implementation/physicaldrivegetter/... -> PASS
  • TestRHEL8_PhysicalDrives_Success now asserts IsPartition per entry.

@ezekiel-alexrod
ezekiel-alexrod requested a review from a team as a code owner July 17, 2026 08:08
@ezekiel-alexrod ezekiel-alexrod self-assigned this Jul 17, 2026

@TeddyAndrieux TeddyAndrieux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IMHO both changes shouldn't be merged here see my comments

Comment thread pkg/implementation/logicalvolumemanager/mdadm.go Outdated
Comment thread pkg/implementation/physicaldrivegetter/rhel8.go Outdated
The RHEL8 getter returns partition rows (lsblk TYPE=part) alongside their
parent disk. Callers previously had to re-derive partition-ness from device
names to tell them apart.

Add an IsPartition field to the PhysicalDrive entity and set it in the RHEL8
getter (device.Type == "part"), so consumers can distinguish partitions from
whole disks without string heuristics. Whole disks and partitions are both
still returned; only the flag is new.
@ezekiel-alexrod
ezekiel-alexrod force-pushed the fix/rhel8-getter-exclude-partitions-and-single-drive-force branch from ae28251 to bd8c985 Compare July 17, 2026 13:18
@ezekiel-alexrod ezekiel-alexrod changed the title fix(rhel8): exclude partitions from listing and force single-device RAID0 feat(physicaldrive): flag partitions with an IsPartition field Jul 17, 2026

@TeddyAndrieux TeddyAndrieux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lgtm

@ezekiel-alexrod
ezekiel-alexrod merged commit 8d9cdb5 into main Jul 17, 2026
8 checks passed
@ezekiel-alexrod
ezekiel-alexrod deleted the fix/rhel8-getter-exclude-partitions-and-single-drive-force branch July 17, 2026 13:35
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.

2 participants