From 69b9f115c91a33cfcd01d2705266a185046a7ac4 Mon Sep 17 00:00:00 2001 From: Tomas Hozza Date: Wed, 11 May 2022 12:24:59 +0200 Subject: [PATCH] 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. --- internal/cloudapi/v2/server.go | 2 +- internal/worker/server.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/cloudapi/v2/server.go b/internal/cloudapi/v2/server.go index 657b7ce50..003b424f1 100644 --- a/internal/cloudapi/v2/server.go +++ b/internal/cloudapi/v2/server.go @@ -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) } diff --git a/internal/worker/server.go b/internal/worker/server.go index 149ac82d0..857db3b1c 100644 --- a/internal/worker/server.go +++ b/internal/worker/server.go @@ -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) {