Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions ocp_resources/mig_controller.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md


from typing import Any

from ocp_resources.resource import NamespacedResource


class MigController(NamespacedResource):
"""
MigController is the Schema for the migcontrollers API.
"""

api_group: str = NamespacedResource.ApiGroup.MIGRATIONS_KUBEVIRT_IO

def __init__(
self,
image_pull_policy: str | None = None,
infra: dict[str, Any] | None = None,
priority_class: str | None = None,
**kwargs: Any,
) -> None:
r"""
Args:
image_pull_policy (str): PullPolicy describes a policy for if/when to pull a container image

infra (dict[str, Any]): Rules on which nodes infrastructure pods will be scheduled

priority_class (str): PriorityClass of the control plane

"""
super().__init__(**kwargs)

self.image_pull_policy = image_pull_policy
self.infra = infra
self.priority_class = priority_class

def to_dict(self) -> None:
super().to_dict()

if not self.kind_dict and not self.yaml_file:
self.res["spec"] = {}
_spec = self.res["spec"]

if self.image_pull_policy is not None:
_spec["imagePullPolicy"] = self.image_pull_policy

if self.infra is not None:
_spec["infra"] = self.infra

if self.priority_class is not None:
_spec["priorityClass"] = self.priority_class

# End of generated code