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.
This commit is contained in:
Tomas Hozza 2022-07-01 17:01:58 +02:00 committed by Tom Gundersen
parent 776a54135f
commit c4ba6d8b11

View file

@ -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