From 6291eddbf287de9771c11f78772d7bc8b5dd2cd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Wed, 19 Oct 2022 14:33:07 +0200 Subject: [PATCH] koji: put artifacts uploaded to koji under a second level directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Koji clean-up doesn't delete the top-level directories. As we named every top-level directory different, they were just cumulating on kojihub, which is obviously wrong. This commit changes that behaviour to put all the temporary directories under a new osbuild-cg top-level one. This way, osbuild-cg won't ve ever cleaned, whereas osbuild-cg/osbuild-composer-koji-{UUID} will be, which is exactly what we want. Closes: https://github.com/osbuild/osbuild-composer/issues/3064 Signed-off-by: Ondřej Budai --- internal/cloudapi/v2/server.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/cloudapi/v2/server.go b/internal/cloudapi/v2/server.go index 9c95002f5..b409997ae 100644 --- a/internal/cloudapi/v2/server.go +++ b/internal/cloudapi/v2/server.go @@ -14,9 +14,10 @@ import ( "github.com/google/uuid" "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" - "github.com/osbuild/osbuild-composer/pkg/jobqueue" "github.com/sirupsen/logrus" + "github.com/osbuild/osbuild-composer/pkg/jobqueue" + "github.com/osbuild/osbuild-composer/internal/blueprint" "github.com/osbuild/osbuild-composer/internal/common" "github.com/osbuild/osbuild-composer/internal/container" @@ -185,7 +186,7 @@ func (s *Server) enqueueCompose(distribution distro.Distro, bp blueprint.Bluepri func (s *Server) enqueueKojiCompose(taskID uint64, server, name, version, release string, distribution distro.Distro, bp blueprint.Blueprint, manifestSeed int64, irs []imageRequest, channel string) (uuid.UUID, error) { var id uuid.UUID - kojiDirectory := "osbuild-composer-koji-" + uuid.New().String() + kojiDirectory := "osbuild-cg/osbuild-composer-koji-" + uuid.New().String() initID, err := s.workers.EnqueueKojiInit(&worker.KojiInitJob{ Server: server,