worker: check for empty osbuild job output
Add an additional check to ensure empty osbuild output is marked as an error. Add an error case for failed parsing of dynamic args.
This commit is contained in:
parent
0fb96345f2
commit
3f8bd5da67
1 changed files with 2 additions and 1 deletions
|
|
@ -57,7 +57,7 @@ func validateResult(result *worker.OSBuildJobResult, jobID string) {
|
|||
}
|
||||
// if the job failed, but the JobError is
|
||||
// nil, we still need to handle this as an error
|
||||
if !result.OSBuildOutput.Success {
|
||||
if result.OSBuildOutput == nil || !result.OSBuildOutput.Success {
|
||||
reason := "osbuild job was unsuccessful"
|
||||
logWithId.Errorf("osbuild job failed: %s", reason)
|
||||
result.JobError = clienterrors.WorkerClientError(clienterrors.ErrorBuildJob, reason)
|
||||
|
|
@ -111,6 +111,7 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
|
|||
var manifestJR worker.ManifestJobByIDResult
|
||||
err = job.DynamicArgs(0, &manifestJR)
|
||||
if err != nil {
|
||||
osbuildJobResult.JobError = clienterrors.WorkerClientError(clienterrors.ErrorParsingDynamicArgs, "Error parsing dynamic args")
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue