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

Open Beginner friendly
#2,849 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@AmenB is already working on this.

Since Nov 2, 2026.

  • #2850 by @AmenB — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
kubernetes, python
Domain
backend

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_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
Dominant language
Python
Stars
28
Forks
85
Avg merge
1d 27m
Merged PRs (30d)
28

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RedHatQE/openshift-python-wrapper

All issues in RedHatQE/openshift-python-wrapper

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.