Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 367194c

Browse files
committedNov 19, 2024·
disk: update for new MinSize type
1 parent f2a58ee commit 367194c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎pkg/disk/disk_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func blueprintApplied(pt *disk.PartitionTable, bp []blueprint.FilesystemCustomiz
146146
}
147147
for idx, ent := range path {
148148
if sz, ok := ent.(disk.Sizeable); ok {
149-
if sz.GetSize() < mnt.MinSize {
149+
if sz.GetSize() < mnt.MinSize.Uint64() {
150150
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)
151151
}
152152
}
@@ -178,7 +178,7 @@ func TestCreatePartitionTable(t *testing.T) {
178178

179179
sumSizes := func(bp []blueprint.FilesystemCustomization) (sum uint64) {
180180
for _, mnt := range bp {
181-
sum += mnt.MinSize
181+
sum += mnt.MinSize.Uint64()
182182
}
183183
return sum
184184
}

‎pkg/disk/partition_table.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ func (pt *PartitionTable) applyCustomization(mountpoints []blueprint.FilesystemC
428428
newMountpoints := []blueprint.FilesystemCustomization{}
429429

430430
for _, mnt := range mountpoints {
431-
size := clampFSSize(mnt.Mountpoint, mnt.MinSize)
431+
size := clampFSSize(mnt.Mountpoint, mnt.MinSize.Uint64())
432432
if path := entityPath(pt, mnt.Mountpoint); len(path) != 0 {
433433
size = alignEntityBranch(path, size)
434434
resizeEntityBranch(path, size)

0 commit comments

Comments
 (0)
Please sign in to comment.