Coverage for ocp_resources/constants.py: 100%
14 statements
« prev ^ index » next coverage.py v7.6.9, created at 2024-12-18 18:22 +0200
« prev ^ index » next coverage.py v7.6.9, created at 2024-12-18 18:22 +0200
1from __future__ import annotations
3from typing import Dict, List
4from kubernetes.dynamic.exceptions import (
5 ForbiddenError,
6 InternalServerError,
7 NotFoundError,
8 ServerTimeoutError,
9)
10from urllib3.exceptions import MaxRetryError, ProtocolError
12DEFAULT_CLUSTER_RETRY_EXCEPTIONS: Dict[type[Exception], List[str]] = {
13 MaxRetryError: [],
14 ConnectionAbortedError: [],
15 ConnectionResetError: [],
16 InternalServerError: [
17 "etcdserver: leader changed",
18 "etcdserver: request timed out",
19 "Internal error occurred: failed calling webhook",
20 "rpc error:",
21 ],
22 ServerTimeoutError: [],
23 ForbiddenError: ["context deadline exceeded"],
24}
25PROTOCOL_ERROR_EXCEPTION_DICT: Dict[type[Exception], List[str]] = {ProtocolError: []}
26NOT_FOUND_ERROR_EXCEPTION_DICT: Dict[type[Exception], List[str]] = {NotFoundError: []}
28TIMEOUT_5SEC: int = 5
29TIMEOUT_10SEC: int = 10
30TIMEOUT_30SEC: int = 30
31TIMEOUT_1MINUTE: int = 60
32TIMEOUT_2MINUTES: int = 2 * 60
33TIMEOUT_4MINUTES: int = 4 * 60
34TIMEOUT_10MINUTES: int = 10 * 60