Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Layered operator design #69

Closed
gazarenkov opened this issue Dec 13, 2023 · 3 comments
Closed

Layered operator design #69

gazarenkov opened this issue Dec 13, 2023 · 3 comments
Assignees
Labels
jira Issue will be sync'ed to Red Hat JIRA kind/epic
Milestone

Comments

@gazarenkov
Copy link
Member

gazarenkov commented Dec 13, 2023

The goal of this issue is redesigning the Operator making it layered for:

  • separate the internal configuration logic (the biggest part) from the K8s API calls
  • better testability, implementing the absolute most testing logic as plain unit tests, decreasing amount of big and slow K8s envtests
  • better documentation and, therefore supportability, to be able to express how operator is designed.
@rm3l
Copy link
Member

rm3l commented Dec 22, 2023

Priority right now is to have the first version of the operator out there for RHDH 1.1. We have something working even with all the imperfections in the codebase and tests structure, and QE/Docs will start trying it out as soon as possible.
Can we postpone this refactoring until after this first version is released?

@gazarenkov
Copy link
Member Author

The thing is that our initial version is mostly POC (it is not good and not bad, we just had to start somehow), as a consequence:

  • it is difficult to make Design/arch documentation since it mostly working as a plain script for creating K8s objects
  • It is difficult to support and improve for the same reason
  • it is difficult to test because logic is not layered, so all we can do is integration (envtest) tests for Controller, no unit tests which means:
    • slow run time
    • a lot of poorly structured code, which is difficult to understand (not being an author) and maintain

So, I would still highly recommend to look at #70 and not to postpone applying it unless there are no objections per se.
It is not that much work to do to check and fix if needed. It already contain more tests than older one and only a couple of integration tests are not passed (commented for the time) and mostly the reason of not passing is clear.
I believe spending some time now will save a lot of time in the future.

@gazarenkov gazarenkov changed the title [TECH DEBT] Move operator configuration logic out of controller. Refactor operator. Jan 4, 2024
@rm3l rm3l linked a pull request Jan 10, 2024 that will close this issue
@gazarenkov gazarenkov changed the title Refactor operator. Layered operator design Feb 14, 2024
@gazarenkov gazarenkov added jira Issue will be sync'ed to Red Hat JIRA kind/epic labels Feb 14, 2024
@gazarenkov gazarenkov added this to the M3 milestone Feb 28, 2024
@gazarenkov
Copy link
Member Author

JIRA

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
jira Issue will be sync'ed to Red Hat JIRA kind/epic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants