upload/koji: don't depend on upload target results data structures

Modify the Koji image extra metadata to not depend on the upload target
data structures for upload results. The target results are supposed to
be specific to the uploader implementation, which will eventually
change. Moreover, the definition is internal to osbuild-composer, so
this would create a problem once the Koji upload implementation is moved
to osbuild/images.

The Koji upload implementation does not really care about the exact
structure of the upload results. It is just a list of JSON objects.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2025-07-07 16:15:15 +02:00 committed by Tomáš Hozza
parent 0bafc0915d
commit 2ceffb3796
2 changed files with 5 additions and 4 deletions

View file

@ -208,8 +208,8 @@ func (impl *KojiFinalizeJobImpl) Run(job worker.Job) error {
// 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
for _, result := range nonKojiTargetResults {
imgOutputExtraInfo.UploadTargetResults = append(imgOutputExtraInfo.UploadTargetResults, result)
}
imgOutputsExtraInfo[imageFilename] = imgOutputExtraInfo

View file

@ -98,8 +98,9 @@ type ImageExtraInfo struct {
// Version of the osbuild binary used by the worker to build the image
OSBuildVersion string `json:"osbuild_version,omitempty"`
// Results from any upload targets associated with the image
// except for the Koji target.
UploadTargetResults []*target.TargetResult `json:"upload_target_results,omitempty"`
// The structure of the data does not need to be known by the consumer,
// it is just a list of JSON objects.
UploadTargetResults []interface{} `json:"upload_target_results,omitempty"`
}
func (ImageExtraInfo) isImageOutputTypeMD() {}