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.
This commit is contained in:
Achilleas Koutsou 2023-05-05 14:21:27 +02:00 committed by Simon de Vlieger
parent 0eeb7e47b0
commit f1557fc4e4

View file

@ -15,14 +15,39 @@ type Pipeline interface {
Export() *artifact.Artifact Export() *artifact.Artifact
getCheckpoint() bool getCheckpoint() bool
getExport() bool getExport() bool
// getBuildPackages returns the list of packages required for the pipeline
// at build time.
getBuildPackages() []string 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 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) serializeStart([]rpmmd.PackageSpec)
serializeEnd() serializeEnd()
serialize() osbuild.Pipeline serialize() osbuild.Pipeline
// getPackageSpecs returns the list of specifications for packages that
// will be installed to the pipeline tree.
getPackageSpecs() []rpmmd.PackageSpec 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 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 getInline() []string
} }
@ -71,6 +96,14 @@ func (p Base) getPackageSetChain() []rpmmd.PackageSet {
return nil return nil
} }
func (p Base) getContainerSources() []container.SourceSpec {
return nil
}
func (p Base) getOSTreeCommitSources() []ostree.SourceSpec {
return nil
}
func (p Base) getPackageSpecs() []rpmmd.PackageSpec { func (p Base) getPackageSpecs() []rpmmd.PackageSpec {
return []rpmmd.PackageSpec{} return []rpmmd.PackageSpec{}
} }