Port osbuild/images v0.33.0 with dot-notation to composer

Update the osbuild/images to the version which introduces "dot notation"
for distro release versions.

 - Replace all uses of distroregistry by distrofactory.
 - Delete local version of reporegistry and use the one from the
   osbuild/images.
 - Weldr: unify `createWeldrAPI()` and `createWeldrAPI2()` into a single
   `createTestWeldrAPI()` function`.
 - store/fixture: rework fixtures to allow overriding the host distro
   name and host architecture name. A cleanup function to restore the
   host distro and arch names is always part of the fixture struct.
 - Delete `distro_mock` package, since it is no longer used.
 - Bump the required version of osbuild to 98, because the OSCAP
   customization is using the 'compress_results' stage option, which is
   not available in older versions of osbuild.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2024-01-08 17:58:49 +01:00 committed by Achilleas Koutsou
parent f6ff8c40dd
commit 625b1578fa
1166 changed files with 154457 additions and 5508 deletions

View file

@ -15,12 +15,13 @@ import (
"io"
"os"
"path/filepath"
"sort"
"strings"
"github.com/osbuild/images/pkg/blueprint"
"github.com/osbuild/images/pkg/container"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/distroregistry"
"github.com/osbuild/images/pkg/distrofactory"
"github.com/osbuild/images/pkg/manifest"
"github.com/osbuild/images/pkg/ostree"
"github.com/osbuild/images/pkg/rhsm/facts"
@ -208,6 +209,15 @@ func makeManifestJob(name string, imgType distro.ImageType, cr composeRequest, d
type DistroArchRepoMap map[string]map[string][]repository
func (darm DistroArchRepoMap) ListDistros() []string {
distros := make([]string, 0, len(darm))
for d := range darm {
distros = append(distros, d)
}
sort.Strings(distros)
return distros
}
func convertRepo(r repository) rpmmd.RepoConfig {
var urls []string
if r.BaseURL != "" {
@ -447,7 +457,7 @@ func main() {
seedArg := int64(0)
darm := readRepos()
distroReg := distroregistry.NewDefault()
distroFac := distrofactory.NewDefault()
jobs := make([]manifestJob, 0)
requestMap := loadFormatRequestMap()
@ -459,10 +469,10 @@ func main() {
fmt.Println("Collecting jobs")
if len(distros) == 0 {
distros = distroReg.List()
distros = darm.ListDistros()
}
for _, distroName := range distros {
distribution := distroReg.GetDistro(distroName)
distribution := distroFac.GetDistro(distroName)
if distribution == nil {
fmt.Fprintf(os.Stderr, "invalid distro name %q\n", distroName)
continue