Worker/koji-finalize: add cloud target results to image/build metadata

Add any non-Koji upload target results attached to an OSBuild result, to
the image extra metadata. This will make it easy to locate any image
from Koji uploaded to cloud, in the target cloud environment.

The rationale behind including only non-Koji target results is that one
can find it only in Koji, so there is no added value in including the
Koji target results at all.

Extend the `koji.sh` to check the target results in image metadata when
testing Koji scenario with cloud upload.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2023-09-19 18:00:23 +02:00 committed by Tomáš Hozza
parent e0ec3a2a1c
commit 4f51d44762
5 changed files with 201 additions and 0 deletions

View file

@ -196,6 +196,13 @@ func (impl *KojiFinalizeJobImpl) Run(job worker.Job) error {
imageFilename = args.KojiFilenames[i]
}
// If there are any non-Koji target results in the build,
// add them to the image output extra metadata.
nonKojiTargetResults := buildResult.TargetResultsFilterByName([]target.TargetName{target.TargetNameKoji})
if len(nonKojiTargetResults) > 0 {
imgOutputExtraInfo.UploadTargetResults = nonKojiTargetResults
}
imgOutputsExtraInfo[imageFilename] = imgOutputExtraInfo
// Image output