Coverage for ocp_resources/node_config_openshift_io.py: 0%
17 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, Optional
4from ocp_resources.resource import Resource
7class Node(Resource):
8 """
9 Node holds cluster-wide information about node specific features.
10 Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
11 """
13 api_group: str = Resource.ApiGroup.CONFIG_OPENSHIFT_IO
15 def __init__(
16 self,
17 cgroup_mode: Optional[str] = "",
18 worker_latency_profile: Optional[str] = "",
19 **kwargs: Any,
20 ) -> None:
21 """
22 Args:
23 cgroup_mode (str): CgroupMode determines the cgroups version on the node
25 worker_latency_profile (str): WorkerLatencyProfile determins the how fast the kubelet is updating
26 the status and corresponding reaction of the cluster
28 """
29 super().__init__(**kwargs)
31 self.cgroup_mode = cgroup_mode
32 self.worker_latency_profile = worker_latency_profile
34 def to_dict(self) -> None:
35 super().to_dict()
37 if not self.kind_dict and not self.yaml_file:
38 self.res["spec"] = {}
39 _spec = self.res["spec"]
41 if self.cgroup_mode:
42 _spec["cgroupMode"] = self.cgroup_mode
44 if self.worker_latency_profile:
45 _spec["workerLatencyProfile"] = self.worker_latency_profile
47 # End of generated code