rhsm: move FactsImageOptions to the rhsm/facts package

Move the FactsImageOptions from distro to the new rhsm/facts package.
At the same time define the values we use as an enum, including the
"test-manifest" value.
Though the values don't really matter, the test value is defined first
so it takes the 0 value, which feels nicer conceptually.

The field in the distro.ImageOptions is changed to be a pointer to allow
for nil values.
This commit is contained in:
Achilleas Koutsou 2023-05-05 14:46:39 +02:00 committed by Simon de Vlieger
parent f1557fc4e4
commit ffa1e1df17
10 changed files with 50 additions and 21 deletions

View file

@ -39,6 +39,7 @@ import (
"github.com/osbuild/osbuild-composer/internal/osbuild"
"github.com/osbuild/osbuild-composer/internal/ostree"
"github.com/osbuild/osbuild-composer/internal/reporegistry"
"github.com/osbuild/osbuild-composer/internal/rhsm/facts"
"github.com/osbuild/osbuild-composer/internal/rpmmd"
"github.com/osbuild/osbuild-composer/internal/store"
"github.com/osbuild/osbuild-composer/internal/target"
@ -2497,8 +2498,8 @@ func (api *API) composeHandler(writer http.ResponseWriter, request *http.Request
Size: size,
OSTree: ostreeOptions,
}
options.Facts = &distro.FactsImageOptions{
ApiType: "weldr",
options.Facts = &facts.ImageOptions{
APIType: facts.WELDR_APITYPE,
}
packageSets, err := api.depsolveBlueprintForImageType(*bp, options, imageType)