osbuild: simplify and unify tree stage inputs

- Remove stage-specific input types when they are org.osbuild.tree input
  types.
- Use PipelineTreeInputs when stage requires a single tree input
  reference with an arbitrary key.
- For Stages that require a specific key with a tree input, make the key
  part of the NewXStage() function and only allow specifying the name of
  the pipeline from which to copy the tree as part of the function
  arguments.
This commit is contained in:
Achilleas Koutsou 2022-09-20 20:34:35 +02:00 committed by Christian Kellner
parent ca0175c82b
commit 3d772b6846
19 changed files with 72 additions and 222 deletions

View file

@ -49,11 +49,6 @@ func (p *OSTreeCommit) serialize() osbuild.Pipeline {
pipeline.AddStage(osbuild.NewOSTreeInitStage(&osbuild.OSTreeInitStageOptions{Path: "/repo"}))
commitStageInput := new(osbuild.OSTreeCommitStageInput)
commitStageInput.Type = "org.osbuild.tree"
commitStageInput.Origin = "org.osbuild.pipeline"
commitStageInput.References = osbuild.OSTreeCommitStageReferences{"name:" + p.treePipeline.Name()}
var parent string
if p.treePipeline.OSTree.Parent != nil {
parent = p.treePipeline.OSTree.Parent.Checksum
@ -64,7 +59,7 @@ func (p *OSTreeCommit) serialize() osbuild.Pipeline {
OSVersion: p.OSVersion,
Parent: parent,
},
&osbuild.OSTreeCommitStageInputs{Tree: commitStageInput}),
p.treePipeline.Name()),
)
return pipeline