disk: pass basePartitionTable as pointer

Pass the `basePartitionTable` argument of `CreatePartitionTable`.
Now that we clone the partition table at the beginning of the
method there is no need to pass a copy of the partition table.
This commit is contained in:
Christian Kellner 2021-11-10 18:48:20 +01:00 committed by Tom Gundersen
parent 2280a55e71
commit 3e72e5aa1d
6 changed files with 6 additions and 6 deletions

View file

@ -27,7 +27,7 @@ const (
func CreatePartitionTable(
mountpoints []blueprint.FilesystemCustomization,
imageSize uint64,
basePartitionTable PartitionTable,
basePartitionTable *PartitionTable,
rng *rand.Rand,
) PartitionTable {

View file

@ -44,7 +44,7 @@ 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 = disk.CreatePartitionTable(mountpoints, 1024, &pt, rng)
assert.GreaterOrEqual(t, expectedSize, pt.Size)
}

View file

@ -322,7 +322,7 @@ func (t *imageType) getPartitionTable(
return basePartitionTable, fmt.Errorf("unknown arch: " + archName)
}
return disk.CreatePartitionTable(mountpoints, options.Size, basePartitionTable, rng), nil
return disk.CreatePartitionTable(mountpoints, options.Size, &basePartitionTable, rng), nil
}
// local type for ostree commit metadata used to define commit sources

View file

@ -392,7 +392,7 @@ func (t *imageType) getPartitionTable(
return basePartitionTable, fmt.Errorf("unknown arch: " + archName)
}
return disk.CreatePartitionTable(mountpoints, options.Size, basePartitionTable, rng), nil
return disk.CreatePartitionTable(mountpoints, options.Size, &basePartitionTable, rng), nil
}
func (t *imageType) getDefaultImageConfig() *distro.ImageConfig {

View file

@ -380,7 +380,7 @@ func (t *imageType) getPartitionTable(
return basePartitionTable, fmt.Errorf("unknown arch: " + archName)
}
return disk.CreatePartitionTable(mountpoints, options.Size, basePartitionTable, rng), nil
return disk.CreatePartitionTable(mountpoints, options.Size, &basePartitionTable, rng), nil
}
func (t *imageType) getDefaultImageConfig() *distro.ImageConfig {

View file

@ -357,7 +357,7 @@ func (t *imageType) getPartitionTable(
return basePartitionTable, fmt.Errorf("unknown arch: " + archName)
}
return disk.CreatePartitionTable(mountpoints, options.Size, basePartitionTable, rng), nil
return disk.CreatePartitionTable(mountpoints, options.Size, &basePartitionTable, rng), nil
}
// local type for ostree commit metadata used to define commit sources