@@ -957,7 +957,13 @@ def _kube_v1_api(self) -> kubernetes.client.CoreV1Api:
957957 return kubernetes .client .CoreV1Api (api_client = self .client .client )
958958
959959 def wait_for_status (
960- self , status : str , timeout : int = TIMEOUT_4MINUTES , stop_status : str | None = None , sleep : int = 1
960+ self ,
961+ status : str ,
962+ timeout : int = TIMEOUT_4MINUTES ,
963+ stop_status : str | None = None ,
964+ sleep : int = 1 ,
965+ exceptions_dict : dict [type [Exception ], list [str ]] = PROTOCOL_ERROR_EXCEPTION_DICT
966+ | DEFAULT_CLUSTER_RETRY_EXCEPTIONS ,
961967 ) -> None :
962968 """
963969 Wait for resource to be in status
@@ -966,6 +972,7 @@ def wait_for_status(
966972 status (str): Expected status.
967973 timeout (int): Time to wait for the resource.
968974 stop_status (str): Status which should stop the wait and failed.
975+ exceptions_dict (dict[type[Exception], list[str]]): Dictionary of exceptions to retry on.
969976
970977 Raises:
971978 TimeoutExpiredError: If resource in not in desire status.
@@ -975,10 +982,7 @@ def wait_for_status(
975982 samples = TimeoutSampler (
976983 wait_timeout = timeout ,
977984 sleep = sleep ,
978- exceptions_dict = {
979- ** PROTOCOL_ERROR_EXCEPTION_DICT ,
980- ** DEFAULT_CLUSTER_RETRY_EXCEPTIONS ,
981- },
985+ exceptions_dict = exceptions_dict ,
982986 func = lambda : self .exists ,
983987 )
984988 current_status = None
0 commit comments