worker: save result.json in the composer instead of the worker
In the future remote workers will be introduced. Obviously, the remote worker cannot support the local target. Unfortunately, the current implementation of storing the osbuild result is dependant on it. This commit moves the responsibility of storing osbuild result to the composer process instead of the worker process. The result is transferred from a worker to a composer using extended HTTP API.
This commit is contained in:
parent
a43dd00459
commit
0d4479bbcd
4 changed files with 57 additions and 73 deletions
|
|
@ -93,10 +93,10 @@ func (api *API) addJobHandler(writer http.ResponseWriter, request *http.Request,
|
|||
|
||||
writer.WriteHeader(http.StatusCreated)
|
||||
json.NewEncoder(writer).Encode(Job{
|
||||
ID: nextJob.ComposeID,
|
||||
Distro: nextJob.Distro,
|
||||
Pipeline: nextJob.Pipeline,
|
||||
Targets: nextJob.Targets,
|
||||
ID: nextJob.ComposeID,
|
||||
Distro: nextJob.Distro,
|
||||
Pipeline: nextJob.Pipeline,
|
||||
Targets: nextJob.Targets,
|
||||
OutputType: nextJob.OutputType,
|
||||
})
|
||||
}
|
||||
|
|
@ -121,7 +121,7 @@ func (api *API) updateJobHandler(writer http.ResponseWriter, request *http.Reque
|
|||
return
|
||||
}
|
||||
|
||||
err = api.store.UpdateCompose(id, body.Status, body.Image)
|
||||
err = api.store.UpdateCompose(id, body.Status, body.Image, body.Result)
|
||||
if err != nil {
|
||||
switch err.(type) {
|
||||
case *store.NotFoundError:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue