cloudapi: expose upload status
Expose a more detailed job status result - specifically, include upload status alongside image status. Expand openapi.yml accordingly and add an UploadStatus field to the OSBuildJobResult struct. At the moment, only represent the "success" and "failure" states of UploadStatus - to differentiate between "pending" and "running" would involve significant design decisions and should be addressed in a separate commit.
This commit is contained in:
parent
80f833a69b
commit
899d78f7e1
6 changed files with 51 additions and 33 deletions
|
|
@ -305,10 +305,16 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
|
|||
targetErrors = append(targetErrors, err.Error())
|
||||
}
|
||||
|
||||
var uploadstatus string = "failure"
|
||||
if len(targetErrors) == 0 {
|
||||
uploadstatus = "success"
|
||||
}
|
||||
|
||||
err = job.Update(&worker.OSBuildJobResult{
|
||||
Success: osbuildOutput.Success && len(targetErrors) == 0,
|
||||
OSBuildOutput: osbuildOutput,
|
||||
TargetErrors: targetErrors,
|
||||
UploadStatus: uploadstatus,
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error reporting job result: %v", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue