Coverage for ocp_resources/utils/constants.py: 100%

13 statements  

« prev     ^ index     » next       coverage.py v7.10.1, created at 2025-07-29 12:31 +0300

1from kubernetes.dynamic.exceptions import ( 

2 ForbiddenError, 

3 InternalServerError, 

4 NotFoundError, 

5 ServerTimeoutError, 

6) 

7from urllib3.exceptions import MaxRetryError, ProtocolError 

8 

9DEFAULT_CLUSTER_RETRY_EXCEPTIONS: dict[type[Exception], list[str]] = { 

10 MaxRetryError: [], 

11 ConnectionAbortedError: [], 

12 ConnectionResetError: [], 

13 InternalServerError: [ 

14 "etcdserver: leader changed", 

15 "etcdserver: request timed out", 

16 "Internal error occurred: failed calling webhook", 

17 "rpc error:", 

18 ], 

19 ServerTimeoutError: [], 

20 ForbiddenError: ["context deadline exceeded"], 

21} 

22PROTOCOL_ERROR_EXCEPTION_DICT: dict[type[Exception], list[str]] = {ProtocolError: []} 

23NOT_FOUND_ERROR_EXCEPTION_DICT: dict[type[Exception], list[str]] = {NotFoundError: []} 

24 

25TIMEOUT_1SEC: int = 1 

26TIMEOUT_5SEC: int = 5 

27TIMEOUT_10SEC: int = 10 

28TIMEOUT_30SEC: int = 30 

29TIMEOUT_1MINUTE: int = 60 

30TIMEOUT_2MINUTES: int = 2 * 60 

31TIMEOUT_4MINUTES: int = 4 * 60 

32TIMEOUT_10MINUTES: int = 10 * 60