store: create compose id from PushCompose
Every caller had to make their own uuid and pass that into PushCompose(). Make PushCompose() create the id and return it.
This commit is contained in:
parent
a6338410bc
commit
cef7267a2d
4 changed files with 20 additions and 21 deletions
|
|
@ -1458,12 +1458,7 @@ func (api *API) composeHandler(writer http.ResponseWriter, request *http.Request
|
|||
return
|
||||
}
|
||||
|
||||
reply := ComposeReply{
|
||||
BuildID: uuid.New(),
|
||||
Status: true,
|
||||
}
|
||||
|
||||
err = api.store.PushCompose(imageType, reply.BuildID, bp, api.allRepositories(), packages, buildPackages, cr.Size, targets)
|
||||
composeID, err := api.store.PushCompose(imageType, bp, api.allRepositories(), packages, buildPackages, cr.Size, targets)
|
||||
|
||||
// TODO: we should probably do some kind of blueprint validation in future
|
||||
// for now, let's just 500 and bail out
|
||||
|
|
@ -1477,7 +1472,10 @@ func (api *API) composeHandler(writer http.ResponseWriter, request *http.Request
|
|||
return
|
||||
}
|
||||
|
||||
err = json.NewEncoder(writer).Encode(reply)
|
||||
err = json.NewEncoder(writer).Encode(ComposeReply{
|
||||
BuildID: composeID,
|
||||
Status: true,
|
||||
})
|
||||
common.PanicOnError(err)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue