Skip to content

Commit

Permalink
storage: honor matchers in use_gap autoinstall mode
Browse files Browse the repository at this point in the history
When using the use_gap mode in autoinstall, one may want to ensure that
we use a gap on a specific disk. Unfortunately, the match directives
were silently ignored.

Let's make sure they are honored.

LP: #2080608

Signed-off-by: Olivier Gayot <[email protected]>
  • Loading branch information
ogayot committed Sep 13, 2024
1 parent 6ed532a commit c968e55
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions subiquity/server/controllers/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1624,8 +1624,9 @@ async def run_autoinstall_guided(self, layout):
disk = self.get_bootable_matching_disk(match)
target = GuidedStorageTargetReformat(disk_id=disk.id, allowed=[])
elif mode == "use_gap":
bootable = self.potential_boot_disks(with_reformatting=False)
gap = gaps.largest_gap(bootable)
match = layout.get("match", {})
bootable_disks = self.get_bootable_matching_disks(match)
gap = gaps.largest_gap(bootable_disks)
if not gap:
raise Exception(
"autoinstall cannot configure storage "
Expand Down

0 comments on commit c968e55

Please sign in to comment.