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

@ -22,6 +22,7 @@ import (
"github.com/osbuild/osbuild-composer/internal/distroregistry"
"github.com/osbuild/osbuild-composer/internal/dnfjson"
"github.com/osbuild/osbuild-composer/internal/manifest"
"github.com/osbuild/osbuild-composer/internal/rhsm/facts"
"github.com/osbuild/osbuild-composer/internal/rpmmd"
)
@ -130,8 +131,8 @@ func makeManifestJob(name string, imgType distro.ImageType, cr composeRequest, d
}
// add RHSM fact to detect changes
options.Facts = &distro.FactsImageOptions{
ApiType: "test-manifest",
options.Facts = &facts.ImageOptions{
APIType: facts.TEST_APITYPE,
}
job := func(msgq chan string) (err error) {