debian-forge-composer/cmd/osbuild-worker
Tomas Hozza fd82174469 worker/osbuild: consolidate Koji target options values meaning
When the Koji target support was added to the osbuild job, based on the
osbuild-koji job, the meaning of target option values got messed up.

The side effect of the issue is that when Koji composes are
submitted via Cloud API the resulting image is currently always uploaded
back to the worker server.

`OsBuildKoji` job
-----------------
- `OSBuildKojiJob.ImageName` is set to the filename of the image as
  exported by osbuild.
- `OSBuildKojiJob.KojiFilename` is set to the desired filename which
  should be used when uploading the image to Koji.

`OsBuild` job + `KojiTargetOptions` before
------------------------------------------
- `OSBuildJob.ImageName` is set to the filename of the image as exported
  by osbuild. This is done only by the Cloud API code for Koji composes.
  Cloud API does not set this for regular composes and any other target.
  The variable is set in common case only by Weldr API code with the
  same meaning and it is used by the `OsBuild` job implementation as an
  indication that the image should be uploaded back to the worker server.
- `Target.ImageName` is not set at all. Other targets use it for the
  desired filename which should be used when uploading the image to the
  target environment.
- `KojiTargetOptions.Filename` is set to the desired filename which
  should be used when uploading the image to Koji. All other target
  types use `Filename` variable in their options for the filename of the
  image as exported by osbuild.

`OsBuild` job + `KojiTargetOptions` after
-----------------------------------------
- `OSBuildJob.ImageName` is still set to the filename of the image as
  exported by osbuild. This is kept for a backward compatibility of new
  composer with older workers.
- `Target.ImageName` is set to the desired filename which should be used
  when uploading the image to Koji.
- `KojiTargetOptions.Filename` is set to the filename of the image as
  exported by osbuild.

This change is backward incompatible, meaning that old worker won't be
able to handle Koji compose requests submitted via Cloud API using a new
composer and also a new worker won't be able to handle Koji compose
requests submitted by a new composer. This is intentional, because after
discussion with Ondrej Budai, the Cloud API Koji integration is
currently not used anywhere in production.
2022-06-17 17:37:15 +02:00
..
jobimpl-depsolve.go osbuild-worker: Correct cast of dnfjson error in depsolve job 2022-06-08 23:07:37 +02:00
jobimpl-koji-finalize.go worker/koji-finalize: handle both osbuild and osbuild-koji results 2022-06-10 14:48:18 +01:00
jobimpl-koji-init.go Relax TCP timeouts for koji connections 2022-02-10 14:58:10 +01:00
jobimpl-osbuild-koji.go Move GetRedHatRelease() and GetHostDistroName() to common package 2022-06-10 14:48:18 +01:00
jobimpl-osbuild.go worker/osbuild: consolidate Koji target options values meaning 2022-06-17 17:37:15 +02:00
main.go worker: define job types as constants 2022-06-10 14:48:18 +01:00
osbuild.go worker: don't marshal manifest in byte[] from 2022-02-01 20:28:40 +00:00