cloudapi: multiple upload targets in request

Add an array of targets in the imageRequest and return an array from
ImageRequest.GetTargets() (renamed from GetTarget()).  Currently, the
function still only returns one target, the default for the image type
with the top level upload options.
This commit is contained in:
Achilleas Koutsou 2023-10-23 18:51:43 +02:00 committed by Sanne Raymaekers
parent 9d990ea5da
commit d7ab1f2112
3 changed files with 17 additions and 15 deletions

View file

@ -203,7 +203,7 @@ func (s *Server) enqueueCompose(distribution distro.Distro, bp blueprint.Bluepri
}
id, err = s.workers.EnqueueOSBuildAsDependency(ir.arch.Name(), &worker.OSBuildJob{
Targets: []*target.Target{ir.target},
Targets: ir.targets,
PipelineNames: &worker.PipelineNames{
Build: ir.imageType.BuildPipelines(),
Payload: ir.imageType.PayloadPipelines(),
@ -341,9 +341,9 @@ func (s *Server) enqueueKojiCompose(taskID uint64, server, name, version, releas
kojiTarget.ImageName = kojiFilename
targets := []*target.Target{kojiTarget}
// add any cloud upload target if defined
if ir.target != nil {
targets = append(targets, ir.target)
// add any cloud upload targets if defined
if ir.targets != nil {
targets = append(targets, ir.targets...)
}
buildID, err := s.workers.EnqueueOSBuildAsDependency(ir.arch.Name(), &worker.OSBuildJob{