From 0d81bdb0169dd71f73ee74ddd1eeb6756b78233d Mon Sep 17 00:00:00 2001 From: Elib <73884315+ebattat@users.noreply.github.com> Date: Mon, 7 Oct 2024 09:48:04 +0300 Subject: [PATCH] Fetch dynamic CNV/ODF versions for must gather (#907) --- benchmark_runner/common/oc/oc.py | 8 ++++++-- benchmark_runner/workloads/bootstorm_vm.py | 4 ++-- benchmark_runner/workloads/workloads_operations.py | 2 -- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/benchmark_runner/common/oc/oc.py b/benchmark_runner/common/oc/oc.py index bda9b0c8..85540f9d 100644 --- a/benchmark_runner/common/oc/oc.py +++ b/benchmark_runner/common/oc/oc.py @@ -1387,7 +1387,9 @@ def generate_odf_must_gather(self, destination_path: str = '/tmp', odf_version: :raises: RuntimeError if the command fails. """ if not odf_version: - raise ValueError("ODF version must be provided") + odf_version = ".".join(self.get_odf_version().split(".")[:2]) + if not odf_version: + raise ValueError("ODF version must be provided") folder_path = os.path.join(destination_path, f"odf-must-gather-rhel9-v{odf_version}") @@ -1415,7 +1417,9 @@ def generate_cnv_must_gather(self, destination_path: str = '/tmp', cnv_version: :raises: RuntimeError if the command fails. """ if not cnv_version: - raise ValueError("CNV version must be provided") + cnv_version = ".".join(self.get_cnv_version().split(".")[:2]) + if not cnv_version: + raise ValueError("CNV version must be provided") folder_path = os.path.join(destination_path, f"cnv-must-gather-rhel9-v{cnv_version}") diff --git a/benchmark_runner/workloads/bootstorm_vm.py b/benchmark_runner/workloads/bootstorm_vm.py index 1155ec10..f049f928 100644 --- a/benchmark_runner/workloads/bootstorm_vm.py +++ b/benchmark_runner/workloads/bootstorm_vm.py @@ -209,8 +209,8 @@ def _verify_vm_ssh(self): if self._wait_for_upgrade_version: logger.info(f'Cluster is upgraded to: {self._wait_for_upgrade_version}') if failure: - self._oc.generate_cnv_must_gather(destination_path=self._run_artifacts_path, cnv_version=self._cnv_version) - self._oc.generate_odf_must_gather(destination_path=self._run_artifacts_path, odf_version=self._odf_version) + self._oc.generate_cnv_must_gather(destination_path=self._run_artifacts_path) + self._oc.generate_odf_must_gather(destination_path=self._run_artifacts_path) # google drive if self._google_drive_shared_drive_id: self.upload_run_artifacts_to_google_drive() diff --git a/benchmark_runner/workloads/workloads_operations.py b/benchmark_runner/workloads/workloads_operations.py index 3550620d..dcf0470f 100644 --- a/benchmark_runner/workloads/workloads_operations.py +++ b/benchmark_runner/workloads/workloads_operations.py @@ -60,8 +60,6 @@ def __init__(self): self._redis = self._environment_variables_dict.get('redis', '') self._threads_limit = self._environment_variables_dict.get('threads_limit', '') self._kata_thread_pool_size = self._environment_variables_dict.get('kata_thread_pool_size', '') - self._cnv_version = self._environment_variables_dict.get('cnv_version', '') - self._odf_version = self._environment_variables_dict.get('odf_version', '') if self._scale: self._scale = int(self._scale) self._scale_nodes = self._environment_variables_dict.get('scale_nodes', '')