store/PushCompose: take ImageType and Arch as argumnet rather than strings

Resolve eagerly into real objects, and avoid having to resolve and
error-check again.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2020-03-22 20:55:28 +01:00 committed by msehnout
parent 7d4ad6b649
commit d7aad58897
4 changed files with 29 additions and 20 deletions

View file

@ -208,7 +208,7 @@ func (api *API) submit(writer http.ResponseWriter, request *http.Request, _ http
// Push the requested compose to the store
composeUUID := uuid.New()
// nil is used as an upload target, because LocalTarget is already used in the PushCompose function
err = api.store.PushCompose(distro, composeUUID, &blueprint.Blueprint{}, repoConfigs, packages, buildPackages, arch.Name(), imageType.Name(), 0, nil)
err = api.store.PushCompose(distro, arch, imageType, composeUUID, &blueprint.Blueprint{}, repoConfigs, packages, buildPackages, 0, nil)
if err != nil {
if api.logger != nil {
api.logger.Println("RCM API failed to push compose:", err)