osbuild2/tar: introduce NewTarStagePipelineTreeInputs()

Introduce `NewTarStagePipelineTreeInputs()` returning a pointer to new
`TarStageInputs` structure.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
This commit is contained in:
Tomas Hozza 2022-02-25 22:53:33 +01:00 committed by Tom Gundersen
parent 1b618b1015
commit 9a1cb773f1

View file

@ -114,3 +114,13 @@ func NewTarStage(options *TarStageOptions, inputs *TarStageInputs) *Stage {
Inputs: inputs,
}
}
func NewTarStagePipelineTreeInputs(pipeline string) *TarStageInputs {
tree := new(TarStageInput)
tree.Type = "org.osbuild.tree"
tree.Origin = "org.osbuild.pipeline"
tree.References = []string{"name:" + pipeline}
return &TarStageInputs{
Tree: tree,
}
}