disk: CreatePartitionTable can return errors now

Modify the signature of `CreatePartitionTable` so that it is
possible to return errors from the function. This is not yet
used, but will be in the near future. Change all call sites
accordingly: in most cases we can just bubble up the error.
This commit is contained in:
Christian Kellner 2021-11-10 14:27:52 +00:00 committed by Tom Gundersen
parent 4086bf8dbc
commit 199463547e
6 changed files with 8 additions and 7 deletions

View file

@ -44,7 +44,8 @@ func TestDisk_DynamicallyResizePartitionTable(t *testing.T) {
// math/rand is good enough in this case
/* #nosec G404 */
rng := rand.New(rand.NewSource(0))
pt = disk.CreatePartitionTable(mountpoints, 1024, &pt, rng)
pt, err := disk.CreatePartitionTable(mountpoints, 1024, &pt, rng)
assert.NoError(t, err)
assert.GreaterOrEqual(t, expectedSize, pt.Size)
}