From 5e2617ed494155195d7b33ce99748f2873f0b9bd Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Wed, 26 Jan 2022 19:45:42 +0000 Subject: [PATCH] kojiapi: successful osbuild jobs must have output When we compute the overall status of a koji compose, the individual build jobs are checked. Currently, a job is considered a failure, if a build job has output (`OSBuildOutput`) and the output's `Success` field is `false`. But `OSBuildOutput` will be `nil` when osbuild crashed or refused the manifest input. Therefore the job status is a failure if `OSBuildOutput` is `nil`, since if osbuild was run, and the run was successful we must have a non-`OSBuildOutput` field. --- internal/kojiapi/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/kojiapi/server.go b/internal/kojiapi/server.go index 5f396a6fe..a8e4e3ff3 100644 --- a/internal/kojiapi/server.go +++ b/internal/kojiapi/server.go @@ -260,7 +260,7 @@ func composeStatusFromJobStatus(js *worker.JobStatus, initResult *worker.KojiIni } for _, buildResult := range buildResults { - if buildResult.OSBuildOutput != nil && !buildResult.OSBuildOutput.Success { + if buildResult.OSBuildOutput == nil || !buildResult.OSBuildOutput.Success { return api.ComposeStatusValueFailure } if buildResult.JobError != nil {