diff --git a/testsuite/gateway/gateway_api/hostname.py b/testsuite/gateway/gateway_api/hostname.py index f4c9cb71..af072b19 100644 --- a/testsuite/gateway/gateway_api/hostname.py +++ b/testsuite/gateway/gateway_api/hostname.py @@ -3,7 +3,7 @@ from functools import cached_property from typing import Callable -from openshift_client import selector +from openshift_client import selector, OpenShiftPythonException from testsuite.certificates import Certificate from testsuite.config import settings @@ -43,7 +43,12 @@ class DNSPolicyExposer(Exposer): @cached_property def base_domain(self) -> str: mz_name = settings["control_plane"]["managedzone"] - zone = selector(f"managedzone/{mz_name}", static_context=self.openshift.context).object() + try: + zone = selector(f"managedzone/{mz_name}", static_context=self.openshift.context).object() + except OpenShiftPythonException as exc: + raise OpenShiftPythonException( + f"Unable to find managedzone/{mz_name} in namespace {self.openshift.project}" + ) from exc return f'{generate_tail(5)}.{zone.model["spec"]["domainName"]}' def expose_hostname(self, name, gateway: Gateway) -> Hostname: