stackabletech / stackabletech/operator-rs
Code using `ObjectMetaBuilder::ownerreference_from_resource()` is not unit testable
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 167
- Forks
- 19
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 9
Description
Description
Currently it's impossible to write unit tests for code that calls ObjectMetaBuilder::ownerreference_from_resource(). This is because OwnerReferenceBuilder::build() checks for the uid key which is cannot be set in tests.
Unfortunately this affects pretty much all operator code.
Contributor 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.
Research direction
Start in src/builder/meta.rs, reading ObjectMetaBuilder::ownerreference_from_resource() and OwnerReferenceBuilder::build(). Trace how build() requires uid, then add focused unit coverage for the test scenario described in the issue. Done means callers can be unit tested without needing to set a Kubernetes uid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- infrastructure, testing
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100