image: separate raw image pipeline from InstantiateManifest
Make the pipeline code a reusable function so we can use it in multiple images (edge-raw-image and edge-simplified-installer).
This commit is contained in:
parent
bc4583eb81
commit
8d36e048bc
1 changed files with 13 additions and 8 deletions
|
|
@ -45,13 +45,7 @@ func NewOSTreeRawImage(commit ostree.CommitSpec) *OSTreeRawImage {
|
|||
}
|
||||
}
|
||||
|
||||
func (img *OSTreeRawImage) InstantiateManifest(m *manifest.Manifest,
|
||||
repos []rpmmd.RepoConfig,
|
||||
runner runner.Runner,
|
||||
rng *rand.Rand) (*artifact.Artifact, error) {
|
||||
buildPipeline := manifest.NewBuild(m, runner, repos)
|
||||
buildPipeline.Checkpoint()
|
||||
|
||||
func ostreeCompressedImagePipelines(img *OSTreeRawImage, m *manifest.Manifest, buildPipeline *manifest.Build) *manifest.XZ {
|
||||
osPipeline := manifest.NewOSTreeDeployment(m, buildPipeline, img.Commit, img.OSName, img.Platform)
|
||||
osPipeline.PartitionTable = img.PartitionTable
|
||||
osPipeline.Remote = img.Remote
|
||||
|
|
@ -67,7 +61,18 @@ func (img *OSTreeRawImage) InstantiateManifest(m *manifest.Manifest,
|
|||
xzPipeline := manifest.NewXZ(m, buildPipeline, imagePipeline)
|
||||
xzPipeline.Filename = img.Filename
|
||||
|
||||
art := xzPipeline.Export()
|
||||
return xzPipeline
|
||||
}
|
||||
|
||||
func (img *OSTreeRawImage) InstantiateManifest(m *manifest.Manifest,
|
||||
repos []rpmmd.RepoConfig,
|
||||
runner runner.Runner,
|
||||
rng *rand.Rand) (*artifact.Artifact, error) {
|
||||
buildPipeline := manifest.NewBuild(m, runner, repos)
|
||||
buildPipeline.Checkpoint()
|
||||
|
||||
xzPipeline := ostreeCompressedImagePipelines(img, m, buildPipeline)
|
||||
|
||||
art := xzPipeline.Export()
|
||||
return art, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue