osbuild: function for creating named pipeline tree inputs

Convenience function for creating a map with a single input pointing to
a pipeline's tree with a given key.
Different stages use different keys in the map (often "tree").
Functions will be added for each stage to create a map with the
appropriate key when necessary.
This commit is contained in:
Achilleas Koutsou 2022-09-20 19:33:59 +02:00 committed by Christian Kellner
parent 58966e4b13
commit ca0175c82b

View file

@ -18,3 +18,13 @@ func NewTreeInput(reference string) *TreeInput {
input.References = []string{reference}
return input
}
type PipelineTreeInputs map[string]TreeInput
func NewPipelineTreeInputs(name, pipeline string) *PipelineTreeInputs {
return &PipelineTreeInputs{
name: *NewTreeInput("name:" + pipeline),
}
}
func (PipelineTreeInputs) isStageInputs() {}