Coverage for ocp_resources/cdi.py: 0%
38 statements
« prev ^ index » next coverage.py v7.6.10, created at 2025-01-30 10:48 +0200
« prev ^ index » next coverage.py v7.6.10, created at 2025-01-30 10:48 +0200
1# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md
3from typing import Any, Dict, Optional
4from ocp_resources.resource import Resource
7class CDI(Resource):
8 """
9 CDI is the CDI Operator CRD
10 """
12 api_group: str = Resource.ApiGroup.CDI_KUBEVIRT_IO
14 def __init__(
15 self,
16 cert_config: Optional[Dict[str, Any]] = None,
17 clone_strategy_override: Optional[str] = "",
18 config: Optional[Dict[str, Any]] = None,
19 customize_components: Optional[Dict[str, Any]] = None,
20 image_pull_policy: Optional[str] = "",
21 infra: Optional[Dict[str, Any]] = None,
22 priority_class: Optional[str] = "",
23 uninstall_strategy: Optional[str] = "",
24 workload: Optional[Dict[str, Any]] = None,
25 **kwargs: Any,
26 ) -> None:
27 """
28 Args:
29 cert_config (Dict[str, Any]): certificate configuration
31 clone_strategy_override (str): Clone strategy override: should we use a host-assisted copy even if
32 snapshots are available?
34 config (Dict[str, Any]): CDIConfig at CDI level
36 customize_components (Dict[str, Any]): CustomizeComponents defines patches for components deployed by the CDI
37 operator.
39 image_pull_policy (str): PullPolicy describes a policy for if/when to pull a container image
41 infra (Dict[str, Any]): Selectors and tolerations that should apply to cdi infrastructure
42 components
44 priority_class (str): PriorityClass of the CDI control plane
46 uninstall_strategy (str): CDIUninstallStrategy defines the state to leave CDI on uninstall
48 workload (Dict[str, Any]): Restrict on which nodes CDI workload pods will be scheduled
50 """
51 super().__init__(**kwargs)
53 self.cert_config = cert_config
54 self.clone_strategy_override = clone_strategy_override
55 self.config = config
56 self.customize_components = customize_components
57 self.image_pull_policy = image_pull_policy
58 self.infra = infra
59 self.priority_class = priority_class
60 self.uninstall_strategy = uninstall_strategy
61 self.workload = workload
63 def to_dict(self) -> None:
64 super().to_dict()
66 if not self.kind_dict and not self.yaml_file:
67 self.res["spec"] = {}
68 _spec = self.res["spec"]
70 if self.cert_config:
71 _spec["certConfig"] = self.cert_config
73 if self.clone_strategy_override:
74 _spec["cloneStrategyOverride"] = self.clone_strategy_override
76 if self.config:
77 _spec["config"] = self.config
79 if self.customize_components:
80 _spec["customizeComponents"] = self.customize_components
82 if self.image_pull_policy:
83 _spec["imagePullPolicy"] = self.image_pull_policy
85 if self.infra:
86 _spec["infra"] = self.infra
88 if self.priority_class:
89 _spec["priorityClass"] = self.priority_class
91 if self.uninstall_strategy:
92 _spec["uninstallStrategy"] = self.uninstall_strategy
94 if self.workload:
95 _spec["workload"] = self.workload
97 # End of generated code