diff --git a/cmd/osbuild-worker/jobimpl-osbuild.go b/cmd/osbuild-worker/jobimpl-osbuild.go index 8432571e2..358d6ffe0 100644 --- a/cmd/osbuild-worker/jobimpl-osbuild.go +++ b/cmd/osbuild-worker/jobimpl-osbuild.go @@ -236,8 +236,16 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error { Success: false, }, UploadStatus: "failure", + Arch: common.CurrentArch(), } + hostOS, err := common.GetRedHatRelease() + if err != nil { + osbuildJobResult.JobError = clienterrors.WorkerClientError(clienterrors.ErrorBuildJob, err.Error()) + return nil + } + osbuildJobResult.HostOS = hostOS + var outputDirectory string // In all cases it is necessary to report result back to osbuild-composer worker API. @@ -255,7 +263,7 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error { } }() - outputDirectory, err := ioutil.TempDir(impl.Output, job.Id().String()+"-*") + outputDirectory, err = ioutil.TempDir(impl.Output, job.Id().String()+"-*") if err != nil { return fmt.Errorf("error creating temporary output directory: %v", err) } diff --git a/internal/worker/json.go b/internal/worker/json.go index 3f6c64fc9..dc75f965d 100644 --- a/internal/worker/json.go +++ b/internal/worker/json.go @@ -38,6 +38,10 @@ type OSBuildJobResult struct { TargetErrors []string `json:"target_errors,omitempty"` UploadStatus string `json:"upload_status"` PipelineNames *PipelineNames `json:"pipeline_names,omitempty"` + // Host OS of the worker which handled the job + HostOS string `json:"host_os"` + // Architecture of the worker which handled the job + Arch string `json:"arch"` JobResult }