Skip to content

Commit

Permalink
disk: update for new MinSize type
Browse files Browse the repository at this point in the history
  • Loading branch information
mvo5 committed Nov 19, 2024
1 parent f2a58ee commit 367194c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/disk/disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func blueprintApplied(pt *disk.PartitionTable, bp []blueprint.FilesystemCustomiz
}
for idx, ent := range path {
if sz, ok := ent.(disk.Sizeable); ok {
if sz.GetSize() < mnt.MinSize {
if sz.GetSize() < mnt.MinSize.Uint64() {
return fmt.Errorf("entity %d in the path from %s is smaller (%d) than the requested minsize %d", idx, mnt.Mountpoint, sz.GetSize(), mnt.MinSize)
}
}
Expand Down Expand Up @@ -178,7 +178,7 @@ func TestCreatePartitionTable(t *testing.T) {

sumSizes := func(bp []blueprint.FilesystemCustomization) (sum uint64) {
for _, mnt := range bp {
sum += mnt.MinSize
sum += mnt.MinSize.Uint64()
}
return sum
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/disk/partition_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ func (pt *PartitionTable) applyCustomization(mountpoints []blueprint.FilesystemC
newMountpoints := []blueprint.FilesystemCustomization{}

for _, mnt := range mountpoints {
size := clampFSSize(mnt.Mountpoint, mnt.MinSize)
size := clampFSSize(mnt.Mountpoint, mnt.MinSize.Uint64())
if path := entityPath(pt, mnt.Mountpoint); len(path) != 0 {
size = alignEntityBranch(path, size)
resizeEntityBranch(path, size)
Expand Down

0 comments on commit 367194c

Please sign in to comment.