image-builder: use manifest.{Build,Payload}Pipelines
With the new images library changes to move the pipeline roles out of the image types into the manifest we need to tweak osbuild-composer to use the new way of getting the payload and build pipelines. This commit implements that new method based on the manifest instead of the image type. See images pr#1766 for the rational of the change.
This commit is contained in:
parent
361a69e415
commit
5e24db6def
1 changed files with 16 additions and 3 deletions
|
|
@ -14,6 +14,7 @@ import (
|
|||
"github.com/osbuild/images/pkg/distro"
|
||||
"github.com/osbuild/images/pkg/distro/defs"
|
||||
"github.com/osbuild/images/pkg/imagefilter"
|
||||
"github.com/osbuild/images/pkg/manifest"
|
||||
"github.com/osbuild/images/pkg/ostree"
|
||||
)
|
||||
|
||||
|
|
@ -45,7 +46,7 @@ type packagesYAML struct {
|
|||
Exclude []string `yaml:"exclude"`
|
||||
}
|
||||
|
||||
func packageSetsFor(imgType distro.ImageType) (map[string]*packagesYAML, error) {
|
||||
func dummyManifestFor(imgType distro.ImageType) (*manifest.Manifest, error) {
|
||||
var bp blueprint.Blueprint
|
||||
// XXX: '*-simplified-installer' images require the installation device to be specified as a BP customization.
|
||||
// Workaround this for now by setting a dummy device. We should ideally have a way to get image type pkg sets
|
||||
|
|
@ -68,6 +69,14 @@ func packageSetsFor(imgType distro.ImageType) (map[string]*packagesYAML, error)
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return manifest, nil
|
||||
}
|
||||
|
||||
func packageSetsFor(imgType distro.ImageType) (map[string]*packagesYAML, error) {
|
||||
manifest, err := dummyManifestFor(imgType)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
res := make(map[string]*packagesYAML)
|
||||
|
||||
|
|
@ -114,6 +123,10 @@ func describeImage(img *imagefilter.Result, out io.Writer) error {
|
|||
if err != nil && !errors.Is(err, defs.ErrNoPartitionTableForImgType) {
|
||||
return err
|
||||
}
|
||||
m, err := dummyManifestFor(img.ImgType)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
outYaml := &describeImgYAML{
|
||||
Distro: img.Distro.Name(),
|
||||
|
|
@ -123,8 +136,8 @@ func describeImage(img *imagefilter.Result, out io.Writer) error {
|
|||
Bootmode: img.ImgType.BootMode().String(),
|
||||
PartitionType: img.ImgType.PartitionType().String(),
|
||||
DefaultFilename: img.ImgType.Filename(),
|
||||
BuildPipelines: img.ImgType.BuildPipelines(),
|
||||
PayloadPipelines: img.ImgType.PayloadPipelines(),
|
||||
BuildPipelines: m.BuildPipelines(),
|
||||
PayloadPipelines: m.PayloadPipelines(),
|
||||
Packages: pkgSets,
|
||||
PartitionTable: partTable,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue