ostree: move OSTreeImageOptions to the ostree package

Move the ostree image options to the ostree package and rename the type
to ImageOptions (ostree.ImageOptions).
This commit is contained in:
Achilleas Koutsou 2023-05-05 15:11:39 +02:00 committed by Simon de Vlieger
parent ffa1e1df17
commit db431a565d
14 changed files with 114 additions and 69 deletions

View file

@ -462,6 +462,8 @@ func (h *apiHandlers) PostCompose(ctx echo.Context) error {
var ostreeOptions *ostree.SourceSpec
// assume it's an ostree image if the type has a default ostree ref
if imageType.OSTreeRef() != "" {
imageOptions.OSTree = &ostree.ImageOptions{}
ostreeOptions = &ostree.SourceSpec{}
if ir.Ostree != nil {
if ir.Ostree.Ref != nil {

View file

@ -23,6 +23,7 @@ import (
"github.com/osbuild/osbuild-composer/internal/container"
"github.com/osbuild/osbuild-composer/internal/distro"
"github.com/osbuild/osbuild-composer/internal/distroregistry"
"github.com/osbuild/osbuild-composer/internal/ostree"
"github.com/osbuild/osbuild-composer/internal/prometheus"
"github.com/osbuild/osbuild-composer/internal/rpmmd"
"github.com/osbuild/osbuild-composer/internal/target"
@ -454,9 +455,11 @@ func generateManifest(ctx context.Context, workers *worker.Server, depsolveJobID
return
}
options.OSTree.ImageRef = result.Specs[0].Ref
options.OSTree.FetchChecksum = result.Specs[0].Checksum
options.OSTree.URL = result.Specs[0].URL
options.OSTree = &ostree.ImageOptions{
ImageRef: result.Specs[0].Ref,
FetchChecksum: result.Specs[0].Checksum,
URL: result.Specs[0].URL,
}
}
manifest, _, err := imageType.Manifest(b, options, repos, depsolveResults.PackageSpecs, containerSpecs, seed)