From 01fd4cf8dbf10c3614bc8908a101e9ac6621df14 Mon Sep 17 00:00:00 2001 From: Arpit Sharma Date: Mon, 2 Mar 2026 21:49:24 +0530 Subject: [PATCH] Support BENCHMARK_OPERATOR_NAMESPACE for OpenShift CI When set, use BENCHMARK_OPERATOR_NAMESPACE for workload/operator namespace so CI can leave NAMESPACE as the job namespace for the result secret. Fixes permission error: framework cannot write secret in benchmark-operator on the build cluster. --- benchmark_runner/main/environment_variables.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/benchmark_runner/main/environment_variables.py b/benchmark_runner/main/environment_variables.py index 5c7c042b..843e1a51 100644 --- a/benchmark_runner/main/environment_variables.py +++ b/benchmark_runner/main/environment_variables.py @@ -136,9 +136,13 @@ def __init__(self): 'hammerdb': 4.0 } - # Set namespace based on workload + # Set namespace based on workload. + # BENCHMARK_OPERATOR_NAMESPACE is used when set (e.g. OpenShift CI) so the app targets that + # namespace for workload/operator while NAMESPACE can remain the job namespace for the framework. base_workload = self._environment_variables_dict['workload'].split('_')[0] - if EnvironmentVariables.get_env('NAMESPACE'): + if EnvironmentVariables.get_env('BENCHMARK_OPERATOR_NAMESPACE'): + self._environment_variables_dict['namespace'] = EnvironmentVariables.get_env('BENCHMARK_OPERATOR_NAMESPACE') + elif EnvironmentVariables.get_env('NAMESPACE'): self._environment_variables_dict['namespace'] = EnvironmentVariables.get_env('NAMESPACE') elif base_workload in self._environment_variables_dict['workload_namespaces']: default_namespace = self._environment_variables_dict['workload_namespaces'][base_workload]