Commit graph

5 commits

Author SHA1 Message Date
Achilleas Koutsou
93c6336e24 reporegistry: remove unused ReposByArch() function
Since all calls to `ReposByArch()` have been replaced by
`ReposByArchName()`, remove the function and updates tests.
2022-03-09 23:22:06 +00:00
Brian C. Lane
fabe0d28d2 reporegistry: Add a DistroHasRepos helper function
This returns the repos and the found flag, useful for testing if a
distro has any valid repos.
2021-07-12 08:58:42 +02:00
Brian C. Lane
a330d84739 reporegistry: Make ReposByArchName function public
This will be used to select distributions that do not match the host
distro.
2021-07-12 08:58:42 +02:00
Tomas Hozza
aa6665ad01 Use RepoRegistry in composer and Weldr API
Modify composer to use RepoRegistry, instead of loading the host
repositories, when initializing WeldrAPI.

Modify WeldrAPI to use RepoRegistry, instead of a map of repository
definitions. Make sure that the RepoRegistry method specific to image
type is used in Welder where appropriate. Specifically when depsolving a
Blueprint, which is used to build a specific image type. Update Weldr
API unit tests to reflect the change.

Add a new method to RepoRegistry, allowing to get list of repositories,
which should be used for building an image for a given architecture,
without specifying the exact image type. Add relevant unit tests.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-05-14 15:43:00 +02:00
Tomas Hozza
dda9cce03e Add support for image type tags in rpmmd and add RepoRegistry API
Extend the RepoConfig structure to contain new field ImageTypeTags.
Extend also other structures and functions as needed, to support loading
repository definitions, which use this new field. The idea is that a
repository should be used for building all image types, unless it has
some ImageTypeTags defined. In such case, it should be used only for
building the specific image types, which names are specified in the new
field.

Add RepoRegistry as a higher-level API to load and manage repository
definitions for each distribution. Currently it provides one method,
which returns a set of repositories needed to build a given image
type. The RepoRegistry uses the new ImageTypeTags field in the RepoConfig
structure and returns all the needed repositories for the image type.

Modify rpmmd unit tests and add unit tests for RepoRegistry.

Add News entry describing the change done to RepoConfig and its JSON
representation.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-05-14 15:43:00 +02:00