worker: delete TargetErrors from OSBuildJobResult

The `TargetErrors` is not used any more since PR#2192 [1] and there is
no need to keep the backward compatibility any more, because there are
no composer / worker instances in production, which are not running the
modified code.

In addition, delete unit tests covering this legacy error handling.

[1] https://github.com/osbuild/osbuild-composer/pull/2192
This commit is contained in:
Tomas Hozza 2022-06-13 14:47:26 +02:00 committed by Tom Gundersen
parent c63bfe6d83
commit 59ded68457
5 changed files with 8 additions and 167 deletions

View file

@ -44,7 +44,14 @@ func TestComposeStatusFromLegacyError(t *testing.T) {
require.NoError(t, err)
require.Equal(t, jobId, j)
jobResult := worker.OSBuildJobResult{TargetErrors: []string{"Upload error"}}
jobResult := worker.OSBuildJobResult{
JobResult: worker.JobResult{
JobError: &clienterrors.Error{
ID: clienterrors.ErrorUploadingImage,
Reason: "Upload error",
},
},
}
rawResult, err := json.Marshal(jobResult)
require.NoError(t, err)
err = api.workers.FinishJob(token, rawResult)