From 4f1816c1b7f01348d5b16ea331d6a178cde69137 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 7 Jan 2025 13:04:52 +0100 Subject: [PATCH] manifestgen: pass missing repoConfig to preManifest.Serialize() When depsolve is run it returns a list of packageSpecs and the matching repository config. This repo config is different/distinct from the repository config that is passed into depsolve via the package sets or the repositories that are loaded via the reporegistry and needs to be passed into `manifest.Serialize()`. The key different is that the depsovle `repoConfig` contains the repo.Id that match the packageSpec.RepoId. With those two matching IDs we can use librepo (see osbuild PR#1974) to infere what mirror to use for what package. This commit now passes the correct repoConfig into preManifest.Serialize() now. No test (sorry!) as this is really hard to test in isolation, there is nothing observable today from repoConfig and it is impossible to add a "witness" pipelien that could check that the right argument is passed in `pipeline.serializeStart()`. So until we refactor images you will have to take my word for this (sorry again). --- internal/manifestgen/manifestgen.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/manifestgen/manifestgen.go b/internal/manifestgen/manifestgen.go index f1cf05a..0bd7dbf 100644 --- a/internal/manifestgen/manifestgen.go +++ b/internal/manifestgen/manifestgen.go @@ -165,7 +165,7 @@ func (mg *Generator) Generate(bp *blueprint.Blueprint, dist distro.Distro, imgTy // what are these warnings? return fmt.Errorf("warnings during manifest creation: %v", strings.Join(warnings, "\n")) } - packageSpecs, _, err := mg.depsolver(mg.cacheDir, preManifest.GetPackageSetChains(), dist, a.Name()) + packageSpecs, repoConfig, err := mg.depsolver(mg.cacheDir, preManifest.GetPackageSetChains(), dist, a.Name()) if err != nil { return err } @@ -177,7 +177,7 @@ func (mg *Generator) Generate(bp *blueprint.Blueprint, dist distro.Distro, imgTy if err != nil { return err } - mf, err := preManifest.Serialize(packageSpecs, containerSpecs, commitSpecs, nil) + mf, err := preManifest.Serialize(packageSpecs, containerSpecs, commitSpecs, repoConfig) if err != nil { return err }