feat(plan): support convertorLabels and convertorAffinity in Plan resource
維護者通常 1 天內回覆
評估
研究方向
從 ocp_resources/plan.py 開始,參照 convertor_node_selector 在 __init__ 中的接收、儲存,以及在 to_dict() 中寫入 spec["convertorNodeSelector"] 的方式,在其旁邊加入 convertor_labels 和 convertor_affinity 及其 camelCase 的 spec 鍵。在 tests/test_plan.py 中加入文件字串條目和測試案例,檢查每個鍵在設定時出現、在為 None 時省略。當兩個測試都通過且 issue 中的清單皆已滿足時,即為完成。
由索引模型根據 Issue 內容生成。
描述
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_affinityanywhere inocp_resources/plan.py.
Proposed change
Mirror the convertor_node_selector pattern in ocp_resources/plan.py:
__init__params:convertor_labels: dict[str, str] | None = None,convertor_affinity: dict[str, Any] | None = None- Attribute assignment in
__init__ to_dict():if self.convertor_labels is not None: spec["convertorLabels"] = ...and same forconvertorAffinity(next to convertorNodeSelector block, ~line 232)- Docstring entries next to convertor_node_selector's
- Tests in
tests/test_plan.pyasserting spec keys emitted when set and omitted when None
Done
-
convertor_labelsparam maps tospec.convertorLabelsinto_dict() -
convertor_affinityparam maps tospec.convertorAffinityinto_dict() - Docstrings updated
- Tests cover both fields (set and None cases)
-
prek runpasses -
uv run --group tests pytestpasses
- 主要語言
- Python
- 星號
- 28
- 分支
- 85
- 平均合併
- 1 天 27 分鐘
- 30 天內合併 PR
- 28
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
RedHatQE/openshift-python-wrapper 的其他 Issue
-
難度 3/5 1-2 天 新手友好度 67/100
RedHatQE/openshift-python-wrapper#2847 · 1 則留言 ·
維護者通常 1 天內回覆
-
Stale
難度 4/5 3-5 天 新手友好度 15/100
RedHatQE/openshift-python-wrapper#2180 · 125 則留言 ·
維護者通常 1 天內回覆
查看 RedHatQE/openshift-python-wrapper 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
aws/sagemaker-python-sdk#6554 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 78/100
huggingface/diffusers#15170 ·
維護者通常 1 天內回覆
-
[BUG] LLM conflict check ignores MNEMOSYNE_LLM_MAX_TOKENS, so reasoning models return empty replies未關閉
難度 2/5 1-3 小時 新手友好度 62/100
mnemosyne-oss/mnemosyne#1325 ·
維護者通常 1 天內回覆
-
enhancement meshtastic-2.8
難度 2/5 1-3 小時 新手友好度 62/100
pskillen/meshflow-api#459 ·