osbuild-composer/config: support specifying distro aliases

Add new configuration option `distro_aliases`, which is a map of
strings, allowing to specify distro name alias for supported
distributions.

Define aliases for RHEL major versions without the minor version
specified.

For now, the distro aliases map is not used by any API
implementation and it is ignored.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2024-01-09 22:20:41 +01:00 committed by Achilleas Koutsou
parent 43e87632fb
commit cdf57e5bc1
4 changed files with 38 additions and 9 deletions

View file

@ -69,6 +69,9 @@ func NewComposer(config *ComposerConfigFile, stateDir, cacheDir string) (*Compos
}
c.distros = distrofactory.NewDefault()
// TODO: set the c.config.DistroAliases to the distrofactory
// More work is needed to make the distro aliases behavior consistent for Weldr API,
// specifically for picking the correct repositories definition.
c.solver = dnfjson.NewBaseSolver(path.Join(c.cacheDir, "rpmmd"))
c.solver.SetDNFJSONPath(c.config.DNFJson)