worker: use OSBuildJobResult consistently
Workers reported status via an `osbuild.Result`, which only includes osbuild output. Make it report OSBuildJobResult instead, which was meant to be used for this purpose and is already used as the result type in the jobqueue. While at it, add any errors produced by targets into this struct, as well as an overall success flag. Note that this breaks older workers returning the result of an osbuild job to a new composer. I think this is fine in this case, for two reasons: 1. We don't support running different versions of the worker and composer in the weldr API, and remote workers aren't widely used yet. 2. Both osbuild.Result and worker.OSBuildJobResult have a top-level `Success` boolean. Thus, logs are lost in such cases, but the overall status of the compose is not.
This commit is contained in:
parent
a0f080c497
commit
299a5e52ab
7 changed files with 41 additions and 63 deletions
|
|
@ -240,7 +240,7 @@ func composeStatusFromJobStatus(js *worker.JobStatus) string {
|
|||
return "pending"
|
||||
}
|
||||
|
||||
if js.Result.OSBuildOutput != nil && js.Result.OSBuildOutput.Success {
|
||||
if js.Result.Success {
|
||||
return "success"
|
||||
}
|
||||
|
||||
|
|
@ -260,7 +260,7 @@ func imageStatusFromJobStatus(js *worker.JobStatus) string {
|
|||
return "building"
|
||||
}
|
||||
|
||||
if js.Result.OSBuildOutput != nil && js.Result.OSBuildOutput.Success {
|
||||
if js.Result.Success {
|
||||
return "success"
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue