RHEL-86: introduce tarArchivePipeline()
Introduce `tarArchivePipeline()` function returning a pipeline, which creates a Tar archive from another pipeline tree referenced by the pipeline name. Replace `tarStage()` with `osbuild.NewTarStage()` Use the `tarArchivePipeline()` function in respective image type pipelines. Signed-off-by: Tomas Hozza <thozza@redhat.com>
This commit is contained in:
parent
b29d64c496
commit
4ca2e64613
1 changed files with 13 additions and 21 deletions
|
|
@ -187,12 +187,8 @@ func tarPipelines(t *imageType, customizations *blueprint.Customizations, option
|
|||
return nil, err
|
||||
}
|
||||
pipelines = append(pipelines, *treePipeline)
|
||||
tarPipeline := osbuild.Pipeline{
|
||||
Name: "root-tar",
|
||||
Build: "name:build",
|
||||
}
|
||||
tarPipeline.AddStage(tarStage("os", "root.tar.xz"))
|
||||
pipelines = append(pipelines, tarPipeline)
|
||||
tarPipeline := tarArchivePipeline("root-tar", treePipeline.Name, &osbuild.TarStageOptions{Filename: "root.tar.xz"})
|
||||
pipelines = append(pipelines, *tarPipeline)
|
||||
return pipelines, nil
|
||||
}
|
||||
|
||||
|
|
@ -250,7 +246,7 @@ func imageInstallerPipelines(t *imageType, customizations *blueprint.Customizati
|
|||
kernelVer := fmt.Sprintf("%s-%s.%s", kernelPkg.Version, kernelPkg.Release, kernelPkg.Arch)
|
||||
|
||||
tarPath := "/liveimg.tar"
|
||||
tarPayloadStages := []*osbuild.Stage{tarStage("os", tarPath)}
|
||||
tarPayloadStages := []*osbuild.Stage{osbuild.NewTarStage(&osbuild.TarStageOptions{Filename: tarPath}, osbuild.NewTarStagePipelineTreeInputs(treePipeline.Name))}
|
||||
kickstartOptions, err := osbuild.NewKickstartStageOptions(kspath, makeISORootPath(tarPath), customizations.GetUsers(), customizations.GetGroups(), "", "")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -284,12 +280,8 @@ func edgeCommitPipelines(t *imageType, customizations *blueprint.Customizations,
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
tarPipeline := osbuild.Pipeline{
|
||||
Name: "commit-archive",
|
||||
Build: "name:build",
|
||||
}
|
||||
tarPipeline.AddStage(tarStage("ostree-commit", t.Filename()))
|
||||
pipelines = append(pipelines, tarPipeline)
|
||||
tarPipeline := tarArchivePipeline("commit-archive", "ostree-commit", &osbuild.TarStageOptions{Filename: t.Filename()})
|
||||
pipelines = append(pipelines, *tarPipeline)
|
||||
return pipelines, nil
|
||||
}
|
||||
|
||||
|
|
@ -607,14 +599,6 @@ func ostreeCommitPipeline(options distro.ImageOptions, osVersion string) *osbuil
|
|||
return p
|
||||
}
|
||||
|
||||
func tarStage(source, filename string) *osbuild.Stage {
|
||||
tree := new(osbuild.TarStageInput)
|
||||
tree.Type = "org.osbuild.tree"
|
||||
tree.Origin = "org.osbuild.pipeline"
|
||||
tree.References = []string{"name:" + source}
|
||||
return osbuild.NewTarStage(&osbuild.TarStageOptions{Filename: filename}, &osbuild.TarStageInputs{Tree: tree})
|
||||
}
|
||||
|
||||
func containerTreePipeline(repos []rpmmd.RepoConfig, packages []rpmmd.PackageSpec, options distro.ImageOptions, c *blueprint.Customizations, nginxConfigPath, listenPort string) *osbuild.Pipeline {
|
||||
p := new(osbuild.Pipeline)
|
||||
p.Name = "container-tree"
|
||||
|
|
@ -1033,6 +1017,14 @@ func xzArchivePipeline(inputPipelineName, inputFilename, outputFilename string)
|
|||
return p
|
||||
}
|
||||
|
||||
func tarArchivePipeline(name, inputPipelineName string, tarOptions *osbuild.TarStageOptions) *osbuild.Pipeline {
|
||||
p := new(osbuild.Pipeline)
|
||||
p.Name = name
|
||||
p.Build = "name:build"
|
||||
p.AddStage(osbuild.NewTarStage(tarOptions, osbuild.NewTarStagePipelineTreeInputs(inputPipelineName)))
|
||||
return p
|
||||
}
|
||||
|
||||
func qemuPipeline(inputPipelineName, inputFilename, outputFilename string, format osbuild.QEMUFormat, formatOptions osbuild.QEMUFormatOptions) *osbuild.Pipeline {
|
||||
p := new(osbuild.Pipeline)
|
||||
p.Name = string(format)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue