store: give ComposeRequest a real distro

`ComposeRequest` included a `common.Distribution`, which had to be
resolved in PushComposeRequest. Use a real `distro.Distro` object here,
and push resolving it to the rcm package.

Change the `Distribution` on the (lower-case) `composeRequest` to a
string. This struct represents the incoming request. Since we're now
resolving the real distro object from the registry in the same function,
it seems redundant to validate the incoming distro twice.
This commit is contained in:
Lars Karlitski 2020-03-16 23:03:42 +01:00 committed by msehnout
parent f68679c09f
commit c2c8fae093
4 changed files with 20 additions and 24 deletions

View file

@ -116,7 +116,7 @@ func main() {
log.Fatal("The RCM API socket unit is misconfigured. It should contain only one socket.")
}
rcmListener := rcmApiListeners[0]
rcmAPI := rcm.New(logger, store, rpm)
rcmAPI := rcm.New(logger, store, rpm, distros)
go func() {
err := rcmAPI.Serve(rcmListener)
// If the RCM API fails, take down the whole process, not just a single gorutine