manifest: implicitly track pipelines in manifest

Pipelines are now added to their manifest on creation, and we
ensure that dependants are associated with the same manifest.
This commit is contained in:
Tom Gundersen 2022-06-29 20:53:02 +01:00
parent 28b8a790b5
commit 4961a17ba8
17 changed files with 181 additions and 101 deletions

View file

@ -16,13 +16,20 @@ type OSTreeCommitPipeline struct {
// NewOSTreeCommitPipeline creates a new OSTree commit pipeline. The
// treePipeline is the tree representing the content of the commit.
// ref is the ref to create the commit under.
func NewOSTreeCommitPipeline(buildPipeline *BuildPipeline, treePipeline *OSPipeline, ref string) *OSTreeCommitPipeline {
func NewOSTreeCommitPipeline(m *Manifest,
buildPipeline *BuildPipeline,
treePipeline *OSPipeline,
ref string) *OSTreeCommitPipeline {
p := &OSTreeCommitPipeline{
BasePipeline: NewBasePipeline("ostree-commit", buildPipeline, nil),
BasePipeline: NewBasePipeline(m, "ostree-commit", buildPipeline, nil),
treePipeline: treePipeline,
ref: ref,
}
if treePipeline.BasePipeline.manifest != m {
panic("tree pipeline from different manifest")
}
buildPipeline.addDependent(p)
m.addPipeline(p)
return p
}