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

@ -21,6 +21,7 @@ import (
"github.com/osbuild/osbuild-composer/internal/manifest"
"github.com/osbuild/osbuild-composer/internal/osbuild"
"github.com/osbuild/osbuild-composer/internal/ostree"
"github.com/osbuild/osbuild-composer/internal/rhsm/facts"
"github.com/osbuild/osbuild-composer/internal/rpmmd"
"github.com/osbuild/osbuild-composer/internal/subscription"
"github.com/osbuild/osbuild-composer/internal/target"
@ -437,8 +438,8 @@ func (h *apiHandlers) PostCompose(ctx echo.Context) error {
imageOptions := distro.ImageOptions{Size: imageType.Size(0)}
if request.Koji == nil {
imageOptions.Facts = &distro.FactsImageOptions{
ApiType: "cloudapi-v2",
imageOptions.Facts = &facts.ImageOptions{
APIType: facts.CLOUDV2_APITYPE,
}
}