From 97c927de24f81fed9e08cd6c4c0901d1af31f277 Mon Sep 17 00:00:00 2001 From: "D. Paolella" Date: Thu, 16 Jan 2025 16:35:49 +0100 Subject: [PATCH] [konflux] do not use the -container suffix in the NVRs --- doozer/doozerlib/backend/konflux_image_builder.py | 3 +-- doozer/doozerlib/backend/konflux_olm_bundler.py | 3 +-- doozer/tests/backend/test_konflux_olm_bundler.py | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/doozer/doozerlib/backend/konflux_image_builder.py b/doozer/doozerlib/backend/konflux_image_builder.py index a7c2dfa8c..b6aa4f7ca 100644 --- a/doozer/doozerlib/backend/konflux_image_builder.py +++ b/doozer/doozerlib/backend/konflux_image_builder.py @@ -295,10 +295,9 @@ async def update_konflux_db(self, metadata, build_repo, pipelinerun, outcome, bu source_repo = df.labels['io.openshift.build.source-location'] commitish = df.labels['io.openshift.build.commit.id'] - component_name = df.labels['com.redhat.component'] version = df.labels['version'] release = df.labels['release'] - nvr = "-".join([component_name, version, release]) + nvr = "-".join([metadata.distgit_key, version, release]) pipelinerun_name = pipelinerun['metadata']['name'] build_pipeline_url = self.build_pipeline_url(pipelinerun) diff --git a/doozer/doozerlib/backend/konflux_olm_bundler.py b/doozer/doozerlib/backend/konflux_olm_bundler.py index 1a9979716..bdb808e36 100644 --- a/doozer/doozerlib/backend/konflux_olm_bundler.py +++ b/doozer/doozerlib/backend/konflux_olm_bundler.py @@ -542,10 +542,9 @@ async def _update_konflux_db(self, metadata: ImageMetadata, build_repo: BuildRep source_repo = df.labels['io.openshift.build.source-location'] commitish = df.labels['io.openshift.build.commit.id'] - component_name = df.labels['com.redhat.component'] version = df.labels['version'] release = df.labels['release'] - nvr = "-".join([component_name, version, release]) + nvr = "-".join([metadata.get_olm_bundle_short_name(), version, release]) pipelinerun_name = pipelinerun.metadata.name build_pipeline_url = KonfluxClient.build_pipeline_url(pipelinerun) diff --git a/doozer/tests/backend/test_konflux_olm_bundler.py b/doozer/tests/backend/test_konflux_olm_bundler.py index c6ed27074..ed86e85b4 100644 --- a/doozer/tests/backend/test_konflux_olm_bundler.py +++ b/doozer/tests/backend/test_konflux_olm_bundler.py @@ -710,7 +710,7 @@ async def test_update_konflux_db_success(self, mock_build_pipeline_url, mock_doc self.assertEqual(build_record.name, "test-bundle") self.assertEqual(build_record.version, "1.0") self.assertEqual(build_record.release, "1") - self.assertEqual(build_record.nvr, "test-component-1.0-1") + self.assertEqual(build_record.nvr, "test-bundle-1.0-1") self.assertEqual(build_record.group, "test-group") self.assertEqual(build_record.assembly, "test-assembly") self.assertEqual(build_record.source_repo, "https://example.com/source-repo.git") @@ -777,7 +777,7 @@ async def test_update_konflux_db_failure(self, mock_build_pipeline_url, mock_doc self.assertEqual(build_record.name, "test-bundle") self.assertEqual(build_record.version, "1.0") self.assertEqual(build_record.release, "1") - self.assertEqual(build_record.nvr, "test-component-1.0-1") + self.assertEqual(build_record.nvr, "test-bundle-1.0-1") self.assertEqual(build_record.group, "test-group") self.assertEqual(build_record.assembly, "test-assembly") self.assertEqual(build_record.source_repo, "https://example.com/source-repo.git")