From 4f0138a989519bce8eb5b0b16919566222f1ddda Mon Sep 17 00:00:00 2001 From: Eli Battat Date: Mon, 30 Sep 2024 09:53:18 +0300 Subject: [PATCH] Fetch dynamic CNV/ODF versions for must gather --- benchmark_runner/common/oc/oc.py | 4 ++-- benchmark_runner/workloads/bootstorm_vm.py | 4 ++-- benchmark_runner/workloads/workloads_operations.py | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/benchmark_runner/common/oc/oc.py b/benchmark_runner/common/oc/oc.py index bda9b0c8..a2cee0a7 100644 --- a/benchmark_runner/common/oc/oc.py +++ b/benchmark_runner/common/oc/oc.py @@ -1387,7 +1387,7 @@ 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]) folder_path = os.path.join(destination_path, f"odf-must-gather-rhel9-v{odf_version}") @@ -1415,7 +1415,7 @@ 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]) 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 55e9122a..9b35e730 100644 --- a/benchmark_runner/workloads/bootstorm_vm.py +++ b/benchmark_runner/workloads/bootstorm_vm.py @@ -207,8 +207,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', '')