From 4f46f2c4ad7c0a6c07ba0552841d01fcd3180689 Mon Sep 17 00:00:00 2001 From: Ramon Lobillo Mateos <62110535+rlobillo@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:41:11 +0100 Subject: [PATCH 1/2] feat: Add migController resources (#2615) Add migController resource following https://github.com/RedHatQE/openshift-python-wrapper/blob/main/class_generator/README.md --- ocp_resources/mig_controller.py | 55 +++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 ocp_resources/mig_controller.py diff --git a/ocp_resources/mig_controller.py b/ocp_resources/mig_controller.py new file mode 100644 index 0000000000..0f10d319b5 --- /dev/null +++ b/ocp_resources/mig_controller.py @@ -0,0 +1,55 @@ +# 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 From 5fbd88664eced92037322c9cdacc408bd76cd4a0 Mon Sep 17 00:00:00 2001 From: Harel Meir Date: Thu, 14 May 2026 11:44:39 +0300 Subject: [PATCH 2/2] pre commit fix Signed-off-by: Harel Meir --- ocp_resources/mig_controller.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ocp_resources/mig_controller.py b/ocp_resources/mig_controller.py index 0f10d319b5..d3df491b9d 100644 --- a/ocp_resources/mig_controller.py +++ b/ocp_resources/mig_controller.py @@ -36,7 +36,6 @@ def __init__( self.priority_class = priority_class def to_dict(self) -> None: - super().to_dict() if not self.kind_dict and not self.yaml_file: