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:
parent
2280a55e71
commit
3e72e5aa1d
6 changed files with 6 additions and 6 deletions
|
|
@ -27,7 +27,7 @@ const (
|
|||
func CreatePartitionTable(
|
||||
mountpoints []blueprint.FilesystemCustomization,
|
||||
imageSize uint64,
|
||||
basePartitionTable PartitionTable,
|
||||
basePartitionTable *PartitionTable,
|
||||
rng *rand.Rand,
|
||||
) PartitionTable {
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue