From 5e24db6def0a8b79e48bd933c518904ba7c8389d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 18 Aug 2025 13:48:25 +0200 Subject: [PATCH] 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. --- cmd/image-builder/describeimg.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/cmd/image-builder/describeimg.go b/cmd/image-builder/describeimg.go index 4e45e00..e04c061 100644 --- a/cmd/image-builder/describeimg.go +++ b/cmd/image-builder/describeimg.go @@ -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, }