feat(plan): support convertorLabels and convertorAffinity in Plan resource

Đang mở Phù hợp với người mới
#2,849 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@AmenB đang làm issue này rồi.

Từ ngày 2/11/2026.

  • #2850 của @AmenB — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
kubernetes, python
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu từ ocp_resources/plan.py: sao chép cách convertor_node_selector được nhận trong __init__, lưu trữ và ghi vào spec["convertorNodeSelector"] trong to_dict(), sau đó thêm convertor_labels và convertor_affinity bên cạnh với các khóa spec dạng camelCase. Thêm mục docstring và các trường hợp trong tests/test_plan.py để kiểm tra mỗi khóa xuất hiện khi được đặt và bị bỏ qua khi là None. Hoàn thành khi cả hai bài kiểm thử đều đạt và danh sách kiểm tra trong issue được đáp ứng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

The forklift Plan CRD supports spec.convertorLabels (map[string]string) and spec.convertorAffinity (standard Kubernetes affinity dict), but the Plan wrapper (ocp_resources/plan.py) does not expose them. Consumers (e.g. mtv-api-tests, issue RedHatQE/mtv-api-tests#813 for MTV-7085 regression coverage) need to set labels and preferred podAffinity on virt-v2v conversion pods.

Current state

  • convertor_node_selector → spec["convertorNodeSelector"] was added in #2819 — exact pattern to follow.
  • target_affinity → spec["targetAffinity"] already exists as affinity precedent.
  • No convertor_labels / convertor_affinity anywhere in ocp_resources/plan.py.

Proposed change

Mirror the convertor_node_selector pattern in ocp_resources/plan.py:

  1. __init__ params: convertor_labels: dict[str, str] | None = None, convertor_affinity: dict[str, Any] | None = None
  2. Attribute assignment in __init__
  3. to_dict(): if self.convertor_labels is not None: spec["convertorLabels"] = ... and same for convertorAffinity (next to convertorNodeSelector block, ~line 232)
  4. Docstring entries next to convertor_node_selector's
  5. Tests in tests/test_plan.py asserting spec keys emitted when set and omitted when None

Done

  • convertor_labels param maps to spec.convertorLabels in to_dict()
  • convertor_affinity param maps to spec.convertorAffinity in to_dict()
  • Docstrings updated
  • Tests cover both fields (set and None cases)
  • prek run passes
  • uv run --group tests pytest passes
Ngôn ngữ chính
Python
Star
28
Fork
85
Merge trung bình
1 ngày 27 phút
Pull request đã merge (30 ngày)
28

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của RedHatQE/openshift-python-wrapper

Tất cả issue của RedHatQE/openshift-python-wrapper

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.