worker/osbuild: check errors of all job dependencies
Ensure that none of the job dependencies failed. This covers the case when there are more than one job dependencies, which will be the case for Koji composes.
This commit is contained in:
parent
4032dea6d2
commit
66f7eaf440
2 changed files with 28 additions and 7 deletions
|
|
@ -310,6 +310,23 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// Explicitly check that none of the job dependencies failed.
|
||||
// This covers mainly the case when there are more than one job dependencies.
|
||||
for idx := 0; idx < job.NDynamicArgs(); idx++ {
|
||||
var jobResult worker.JobResult
|
||||
err = job.DynamicArgs(idx, &jobResult)
|
||||
if err != nil {
|
||||
osbuildJobResult.JobError = clienterrors.WorkerClientError(clienterrors.ErrorParsingDynamicArgs, "Error parsing dynamic args")
|
||||
return err
|
||||
}
|
||||
|
||||
if jobResult.JobError != nil {
|
||||
osbuildJobResult.JobError = clienterrors.WorkerClientError(clienterrors.ErrorJobDependency, "Job dependency failed")
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// copy pipeline info to the result
|
||||
osbuildJobResult.PipelineNames = args.PipelineNames
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue