From c4ba6d8b1161293f51852a9148f71da8242b56cc Mon Sep 17 00:00:00 2001 From: Tomas Hozza Date: Fri, 1 Jul 2022 17:01:58 +0200 Subject: [PATCH] OSBuildJob: support more than one export and drop `assembler` fallback Drop the fallback to the `assembler` export if no is specified in the job and return Job Error in this case. Remove the constraint to support only a single osbuild export. The job is now able to use multiple osbuild exports and each target may use a different one. --- cmd/osbuild-worker/jobimpl-osbuild.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cmd/osbuild-worker/jobimpl-osbuild.go b/cmd/osbuild-worker/jobimpl-osbuild.go index b2d00d63a..632522ece 100644 --- a/cmd/osbuild-worker/jobimpl-osbuild.go +++ b/cmd/osbuild-worker/jobimpl-osbuild.go @@ -301,12 +301,8 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error { // get exports for all job's targets exports := jobArgs.OsbuildExports() if len(exports) == 0 { - // job did not define exports, likely coming from an older version of composer - // fall back to default "assembler" - exports = []string{"assembler"} - } else if len(exports) > 1 { - // this worker only supports returning one (1) export - return fmt.Errorf("at most one build artifact can be exported") + osbuildJobResult.JobError = clienterrors.WorkerClientError(clienterrors.ErrorInvalidTargetConfig, "no osbuild export specified for the job") + return nil } // Run osbuild and handle two kinds of errors