From f1557fc4e444c47d3c1cfce8fa21afdc74037afd Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Fri, 5 May 2023 14:21:27 +0200 Subject: [PATCH] pipeline: expand interface to return source specs Add two new methods to the interface for returning container source specifications and ostree commit source specifications respectively. These are analogous to the package set chains; they are unresolved source specifications that can be used with the appropriate resolver to create a full specification for a manifest. Only the Base pipeline implements the base empty functions for these for now. --- internal/manifest/pipeline.go | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/internal/manifest/pipeline.go b/internal/manifest/pipeline.go index 72f216cb4..25ae28aeb 100644 --- a/internal/manifest/pipeline.go +++ b/internal/manifest/pipeline.go @@ -15,14 +15,39 @@ type Pipeline interface { Export() *artifact.Artifact getCheckpoint() bool getExport() bool + + // getBuildPackages returns the list of packages required for the pipeline + // at build time. getBuildPackages() []string + // getPackageSetChain returns the list of package names to be required by + // the pipeline. Each set should be depsolved sequentially to resolve + // dependencies and full package specs. See the dnfjson package for more + // details. getPackageSetChain() []rpmmd.PackageSet + // getContainerSources returns the list of containers sources to be resolved and + // embedded by the pipeline. Each source should be resolved to its full + // Spec. See the container package for more details. + getContainerSources() []container.SourceSpec + // getOSTreeCommitSources returns the list of ostree commit sources to be + // resolved and added to the pipeline. Each source should be resolved to + // its full Spec. See the ostree package for more details. + getOSTreeCommitSources() []ostree.SourceSpec + serializeStart([]rpmmd.PackageSpec) serializeEnd() serialize() osbuild.Pipeline + + // getPackageSpecs returns the list of specifications for packages that + // will be installed to the pipeline tree. getPackageSpecs() []rpmmd.PackageSpec - getOSTreeCommits() []ostree.CommitSpec + // getContainerSpecs returns the list of specifications for the containers + // that will be installed to the pipeline tree. getContainerSpecs() []container.Spec + // getOSTreeCommits returns the list of specifications for the commits + // required by the pipeline. + getOSTreeCommits() []ostree.CommitSpec + // getInline returns the list of inlined data content that will be used to + // embed files in the pipeline tree. getInline() []string } @@ -71,6 +96,14 @@ func (p Base) getPackageSetChain() []rpmmd.PackageSet { return nil } +func (p Base) getContainerSources() []container.SourceSpec { + return nil +} + +func (p Base) getOSTreeCommitSources() []ostree.SourceSpec { + return nil +} + func (p Base) getPackageSpecs() []rpmmd.PackageSpec { return []rpmmd.PackageSpec{} }