Coverage for ocp_resources/mariadb_operator.py: 0%
77 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, List, Optional
4from ocp_resources.resource import NamespacedResource
7class MariadbOperator(NamespacedResource):
8 """
9 MariadbOperator is the Schema for the mariadboperators API
10 """
12 api_group: str = NamespacedResource.ApiGroup.HELM_MARIADB_MMONTES_IO
14 def __init__(
15 self,
16 affinity: Optional[Dict[str, Any]] = None,
17 cert_controller: Optional[Dict[str, Any]] = None,
18 cluster_name: Optional[str] = None,
19 extr_args: Optional[List[str]] = None,
20 extra_volume_mounts: Optional[List[Dict[str, Any]]] = None,
21 extra_volumes: Optional[List[Dict[str, Any]]] = None,
22 fullname_override: Optional[str] = None,
23 ha: Optional[Dict[str, Any]] = None,
24 image: Optional[Dict[str, Any]] = None,
25 image_pull_secrets: Optional[List[Dict[str, Any]]] = None,
26 log_level: Optional[str] = None,
27 metrics: Optional[Dict[str, Any]] = None,
28 name_override: Optional[str] = None,
29 node_selector: Optional[Dict[str, str]] = None,
30 pod_annotations: Optional[Dict[str, str]] = None,
31 pod_security_context: Optional[Dict[str, Any]] = None,
32 rbac: Optional[Dict[str, Any]] = None,
33 resources: Optional[Dict[str, Any]] = None,
34 security_context: Optional[Dict[str, Any]] = None,
35 service_account: Optional[Dict[str, Any]] = None,
36 tolerations: Optional[List[Dict[str, Any]]] = None,
37 webhook: Optional[Dict[str, Any]] = None,
38 **kwargs: Any,
39 ) -> None:
40 """
41 Args:
42 affinity (Dict[str, Any]): Node affinity settings for the operator.
43 cert_controller (Dict[str, Any]): Configuration for the certificate controller.
44 cluster_name (str): Name of the Kubernetes cluster.
45 extr_args (List[str]): Additional arguments for the operator.
46 extra_volume_mounts (List[Dict[str, Any]]): Additional volume mounts for the operator.
47 extra_volumes (List[Dict[str, Any]]): Additional volumes for the operator.
48 fullname_override (str): Override for the full name of resources.
49 ha (Dict[str, Any]): High availability configuration.
50 image (Dict[str, Any]): Container image configuration.
51 image_pull_secrets (List[Dict[str, Any]]): Secrets for pulling container images.
52 log_level (str): Logging level for the operator.
53 metrics (Dict[str, Any]): Metrics collection configuration.
54 name_override (str): Override for the name of resources.
55 node_selector (Dict[str, str]): Node selection criteria.
56 pod_annotations (Dict[str, str]): Annotations for the operator pod.
57 pod_security_context (Dict[str, Any]): Security context for the operator pod.
58 rbac (Dict[str, Any]): RBAC configuration.
59 resources (Dict[str, Any]): Resource requirements for the operator.
60 security_context (Dict[str, Any]): Security context for the operator container.
61 service_account (Dict[str, Any]): Service account configuration.
62 tolerations (List[Dict[str, Any]]): Tolerations for node taints.
63 webhook (Dict[str, Any]): Webhook configuration.
64 """
65 super().__init__(**kwargs)
67 self.affinity = affinity
68 self.cert_controller = cert_controller
69 self.cluster_name = cluster_name
70 self.extr_args = extr_args
71 self.extra_volume_mounts = extra_volume_mounts
72 self.extra_volumes = extra_volumes
73 self.fullname_override = fullname_override
74 self.ha = ha
75 self.image = image
76 self.image_pull_secrets = image_pull_secrets
77 self.log_level = log_level
78 self.metrics = metrics
79 self.name_override = name_override
80 self.node_selector = node_selector
81 self.pod_annotations = pod_annotations
82 self.pod_security_context = pod_security_context
83 self.rbac = rbac
84 self.resources = resources
85 self.security_context = security_context
86 self.service_account = service_account
87 self.tolerations = tolerations
88 self.webhook = webhook
90 def to_dict(self) -> None:
91 super().to_dict()
93 if not self.kind_dict and not self.yaml_file:
94 self.res["spec"] = {}
95 _spec = self.res["spec"]
97 if self.affinity is not None:
98 _spec["affinity"] = self.affinity
99 if self.cert_controller is not None:
100 _spec["certController"] = self.cert_controller
101 if self.cluster_name is not None:
102 _spec["clusterName"] = self.cluster_name
103 if self.extr_args is not None:
104 _spec["extrArgs"] = self.extr_args
105 if self.extra_volume_mounts is not None:
106 _spec["extraVolumeMounts"] = self.extra_volume_mounts
107 if self.extra_volumes is not None:
108 _spec["extraVolumes"] = self.extra_volumes
109 if self.fullname_override is not None:
110 _spec["fullnameOverride"] = self.fullname_override
111 if self.ha is not None:
112 _spec["ha"] = self.ha
113 if self.image is not None:
114 _spec["image"] = self.image
115 if self.image_pull_secrets is not None:
116 _spec["imagePullSecrets"] = self.image_pull_secrets
117 if self.log_level is not None:
118 _spec["logLevel"] = self.log_level
119 if self.metrics is not None:
120 _spec["metrics"] = self.metrics
121 if self.name_override is not None:
122 _spec["nameOverride"] = self.name_override
123 if self.node_selector is not None:
124 _spec["nodeSelector"] = self.node_selector
125 if self.pod_annotations is not None:
126 _spec["podAnnotations"] = self.pod_annotations
127 if self.pod_security_context is not None:
128 _spec["podSecurityContext"] = self.pod_security_context
129 if self.rbac is not None:
130 _spec["rbac"] = self.rbac
131 if self.resources is not None:
132 _spec["resources"] = self.resources
133 if self.security_context is not None:
134 _spec["securityContext"] = self.security_context
135 if self.service_account is not None:
136 _spec["serviceAccount"] = self.service_account
137 if self.tolerations is not None:
138 _spec["tolerations"] = self.tolerations
139 if self.webhook is not None:
140 _spec["webhook"] = self.webhook
142 # End of generated code