kojiapi: include image type exports in Koji job args

Koji image request handling now reads the exports defined by each image
type. All APIs now support reading the exports defined by each image
type. The worker still falls back to "assembler" in case the call comes
from an older version of composer.
This commit is contained in:
Achilleas Koutsou 2021-06-08 17:32:55 +02:00 committed by Tom Gundersen
parent 14a74cf173
commit 1a3447ed38
3 changed files with 18 additions and 2 deletions

View file

@ -85,6 +85,7 @@ func (h *apiHandlers) PostCompose(ctx echo.Context) error {
manifest distro.Manifest
arch string
filename string
exports []string
}
imageRequests := make([]imageRequest, len(request.ImageRequests))
@ -138,6 +139,7 @@ func (h *apiHandlers) PostCompose(ctx echo.Context) error {
imageRequests[i].manifest = manifest
imageRequests[i].arch = arch.Name()
imageRequests[i].filename = imageType.Filename()
imageRequests[i].exports = imageType.Exports()
kojiFilenames[i] = fmt.Sprintf(
"%s-%s-%s.%s%s",
@ -165,6 +167,7 @@ func (h *apiHandlers) PostCompose(ctx echo.Context) error {
id, err := h.server.workers.EnqueueOSBuildKoji(ir.arch, &worker.OSBuildKojiJob{
Manifest: ir.manifest,
ImageName: ir.filename,
Exports: ir.exports,
KojiServer: request.Koji.Server,
KojiDirectory: kojiDirectory,
KojiFilename: kojiFilenames[i],