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

@ -27,6 +27,7 @@ import (
"github.com/ubccr/kerby/khttp"
"github.com/osbuild/images/pkg/rpmmd"
"github.com/osbuild/osbuild-composer/internal/target"
)
type Koji struct {
@ -120,6 +121,9 @@ type ImageExtraInfo struct {
Arch string `json:"arch"`
// Boot mode of the image
BootMode string `json:"boot_mode,omitempty"`
// Results from any upload targets associated with the image
// except for the Koji target.
UploadTargetResults []*target.TargetResult `json:"upload_target_results,omitempty"`
}
func (ImageExtraInfo) isImageOutputTypeMD() {}