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]