pingcap / pingcap/tidb-operator
Evaluate controller-runtime
@dragonly is already working on this.
Since Jan 21, 2021.
- Dominant language
- Go
- Stars
- 1.3k
- Forks
- 540
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 18
Description
Question
I've been doing lots of "copy-paste" work when developing #1121 .
It is always debatable that how much abstractions we should do, anyway, DRY(Don't repeat yourself) is somehow opposite to KISS(Keep it simple and stupid). But I start to feel that the boilerplate in our codebase is slightly too much.
We could evaluate some frameworks to see if they can help us simplify the code and logic, actually there is only one possible choice: kubernetes-sigs/controller-runtime.
I did not mention kubebuilder and operator-sdk because I think skeleton tool means little to us (we are not going to adopt a skeleton or code generation tool, at least not in this issue). and the framework they are leveraging is exactly controller-runtime.
#1291 has imported controller-runtime as a dependency to use its generic client. But there are more useful abstractions in controller-runtime that requires minor refactoring to the codebase, we don't have enough effort to land such change in v1.1.0, nor could we do it without thorough discussion and evaluating.
Open this issue for further discussion and evaluating.
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.
Assessment
This issue has not been assessed yet.