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

@ -1438,7 +1438,7 @@ func (api *API) composeHandler(writer http.ResponseWriter, request *http.Request
Status: true,
}
err = api.store.PushCompose(api.distro, reply.BuildID, bp, api.repos, packages, buildPackages, api.arch.Name(), cr.ComposeType, cr.Size, uploadTarget)
err = api.store.PushCompose(api.distro, api.arch, imageType, reply.BuildID, bp, api.repos, packages, buildPackages, cr.Size, uploadTarget)
// TODO: we should probably do some kind of blueprint validation in future
// for now, let's just 500 and bail out