worker: allow enqueueing OSBuild job with multiple dependencies

Change the definition of `EnqueueOSBuildAsDependency()` function to
accept a slice of job IDs on which the OSBuild job depends. Previously,
only the manifest job ID was accepted as the only possible dependency.
This change will be needed in order to enqueue OSBuild jobs for Koji,
which depends on two jobs.
This commit is contained in:
Tomas Hozza 2022-05-11 12:24:59 +02:00 committed by Tom Gundersen
parent da78a76751
commit 69b9f115c9
2 changed files with 3 additions and 3 deletions

View file

@ -153,7 +153,7 @@ func (s *Server) enqueueCompose(distribution distro.Distro, bp blueprint.Bluepri
Build: ir.imageType.BuildPipelines(),
Payload: ir.imageType.PayloadPipelines(),
},
}, manifestJobID, channel)
}, []uuid.UUID{manifestJobID}, channel)
if err != nil {
return id, HTTPErrorWithInternal(ErrorEnqueueingJob, err)
}

View file

@ -104,8 +104,8 @@ func (s *Server) EnqueueOSBuild(arch string, job *OSBuildJob, channel string) (u
return s.enqueue("osbuild:"+arch, job, nil, channel)
}
func (s *Server) EnqueueOSBuildAsDependency(arch string, job *OSBuildJob, manifestID uuid.UUID, channel string) (uuid.UUID, error) {
return s.enqueue("osbuild:"+arch, job, []uuid.UUID{manifestID}, channel)
func (s *Server) EnqueueOSBuildAsDependency(arch string, job *OSBuildJob, dependencies []uuid.UUID, channel string) (uuid.UUID, error) {
return s.enqueue("osbuild:"+arch, job, dependencies, channel)
}
func (s *Server) EnqueueOSBuildKoji(arch string, job *OSBuildKojiJob, initID uuid.UUID, channel string) (uuid.UUID, error) {