@@ -953,7 +953,13 @@ def _kube_v1_api(self) -> kubernetes.client.CoreV1Api:
953953 return kubernetes .client .CoreV1Api (api_client = self .client .client )
954954
955955 def wait_for_status (
956- self , status : str , timeout : int = TIMEOUT_4MINUTES , stop_status : str | None = None , sleep : int = 1
956+ self ,
957+ status : str ,
958+ timeout : int = TIMEOUT_4MINUTES ,
959+ stop_status : str | None = None ,
960+ sleep : int = 1 ,
961+ exceptions_dict : dict [type [Exception ], list [str ]] = PROTOCOL_ERROR_EXCEPTION_DICT
962+ | DEFAULT_CLUSTER_RETRY_EXCEPTIONS ,
957963 ) -> None :
958964 """
959965 Wait for resource to be in status
@@ -962,6 +968,7 @@ def wait_for_status(
962968 status (str): Expected status.
963969 timeout (int): Time to wait for the resource.
964970 stop_status (str): Status which should stop the wait and failed.
971+ exceptions_dict (dict[type[Exception], list[str]]): Dictionary of exceptions to retry on.
965972
966973 Raises:
967974 TimeoutExpiredError: If resource in not in desire status.
@@ -971,10 +978,7 @@ def wait_for_status(
971978 samples = TimeoutSampler (
972979 wait_timeout = timeout ,
973980 sleep = sleep ,
974- exceptions_dict = {
975- ** PROTOCOL_ERROR_EXCEPTION_DICT ,
976- ** DEFAULT_CLUSTER_RETRY_EXCEPTIONS ,
977- },
981+ exceptions_dict = exceptions_dict ,
978982 func = lambda : self .exists ,
979983 )
980984 current_status = None
0 commit comments