From 44ef682ca1d9c6246ccfde235808f46757b1c8bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Mon, 23 Jun 2025 14:32:08 +0200 Subject: [PATCH] cmd/describe: fix describing of OSTree images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OSTree images require additional arguments to serialize their Manifest. The 'describe' command was not setting those, which resulted in errors when describing such image types. Set the required minimum OSTree arguments to dummy values to enable describing of such images. Signed-off-by: Tomáš Hozza --- cmd/image-builder/describeimg.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cmd/image-builder/describeimg.go b/cmd/image-builder/describeimg.go index c9d10cd..2fad913 100644 --- a/cmd/image-builder/describeimg.go +++ b/cmd/image-builder/describeimg.go @@ -13,6 +13,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/ostree" ) // Use yaml output by default because it is both nicely human and @@ -45,7 +46,16 @@ type packagesYAML struct { func packageSetsFor(imgType distro.ImageType) (map[string]*packagesYAML, error) { var bp blueprint.Blueprint - manifest, _, err := imgType.Manifest(&bp, distro.ImageOptions{}, nil, nil) + + var imgOpts distro.ImageOptions + // Mock ostree options for ostree-based images to make describe work + if imgType.OSTreeRef() != "" { + imgOpts.OSTree = &ostree.ImageOptions{ + URL: "http://example.com/repo", + } + } + + manifest, _, err := imgType.Manifest(&bp, imgOpts, nil, nil) if err != nil { return nil, err }