weldr: use compose status for targets as well

Workers don't report status for the osbuild run and the upload targets
separately. Before the move to the jobqueue, we explicitly set the
status of all targets when a compose finished. When I removed that,
the image status broke.

Set the status from what's returned by api.getComposeStatus() to restore
the original behavior.

Fixes #702
This commit is contained in:
Lars Karlitski 2020-06-03 10:51:39 +02:00 committed by Ondřej Budai
parent a48565e06e
commit 347d69b734
4 changed files with 21 additions and 6 deletions

View file

@ -1967,7 +1967,7 @@ func (api *API) composeInfoHandler(writer http.ResponseWriter, request *http.Req
reply.ImageSize = compose.ImageBuild.Size
if isRequestVersionAtLeast(params, 1) {
reply.Uploads = targetsToUploadResponses(compose.ImageBuild.Targets)
reply.Uploads = targetsToUploadResponses(compose.ImageBuild.Targets, composeStatus.State)
}
err = json.NewEncoder(writer).Encode(reply)