feat(plan): support convertorLabels and convertorAffinity in Plan resource
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start in ocp_resources/plan.py: copy how convertor_node_selector is accepted in __init__, stored, and written to spec["convertorNodeSelector"] in to_dict(), then add convertor_labels and convertor_affinity alongside it with their camelCase spec keys. Add docstring entries and cases in tests/test_plan.py that check each key appears when set and is omitted when None. Done when both tests pass and the checklist in the issue is satisfied.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Python
- Stars
- 28
- Forks
- 85
- Avg merge
- 1d 27m
- Merged PRs (30d)
- 28
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RedHatQE/openshift-python-wrapper
-
Feature request: Include restore error details in VirtualMachineFileRestore phase-wait failuresOpen
Difficulty 3/5 1-2 days Newbie friendliness 67/100
RedHatQE/openshift-python-wrapper#2847 · 1 comment ·
Maintainers usually reply within 1 day
-
Dependency DashboardOpenStale
Difficulty 4/5 3-5 days Newbie friendliness 15/100
RedHatQE/openshift-python-wrapper#2180 · 125 comments ·
Maintainers usually reply within 1 day
All issues in RedHatQE/openshift-python-wrapper
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pytest-dev/pyfakefs#1367 · 1 comment ·
Maintainers usually reply within 2 days
-
IFEvalG exclude_word_harder misses the keyword next to punctuation, at the start or end of the text, and in other letter casePossibly taken @damienen claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
allenai/open-instruct#2151 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 25 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
libnativeapi/nativeapi#21 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day