rcm: introduce rpmmd member of the api structure

This is needed for unit tests, because it wasn't possible to mock the
rpmmd module before. This also requires that the checksum is moved to
the compose request and evaluated in the endpoint handler instead of
push compose. I think it makes sense to have the checksum in the compose
request directly.

Also a "module platform ID" is required now, but we don't have the
"global" distribution any more, so this patch introduces mapping from a
distribution to the module platform ID.
This commit is contained in:
Martin Sehnoutka 2020-02-19 11:50:38 +01:00 committed by Tom Gundersen
parent d1c766abe7
commit 923a0b0b97
5 changed files with 72 additions and 20 deletions

View file

@ -72,7 +72,7 @@ func main() {
// Optionally run RCM API as well as Weldr API
if len(listeners) == 3 {
rcmListener := listeners[2]
rcmAPI := rcm.New(logger, store)
rcmAPI := rcm.New(logger, store, rpmmd.NewRPMMD())
go rcmAPI.Serve(rcmListener)
}