-
Notifications
You must be signed in to change notification settings - Fork 64
Consolidate code from catalogd/internal in to operator-controller/internal #1707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What is the target internal architecture we're looking to reach? Is the idea to move all catalogd/internal to operator-controller and have catalogd use dependencies from there meaning it would no longer have its own /internal? The RFC seems to be missing those details and IMO it's important to know the specific thought-out final structure we're looking for. |
HI @azych The idea here is to move the pkg code from catalogd to the root (operator-controller) |
Let me look in to this and get back here with my suggestion , you can review and let me know if that sounds good. |
sounds great, just to clarify - I'm not saying we should have a very low-level detailed plan as in "move file X to here, export functions from file Y to here etc.", but more like general and consistent outline of the final structure that's thought-through, readable and predictable for the future. |
It may end up being the same as what we have in the catalog, just in the root directory (all that is the internal of catalogd will be under internal oper-con). However, if we encounter any issues, we'll need to discuss them as they arise. At this point, it seems complicated to come up with more details before we try it out Suppose we encounter duplications or other issues that block the primary goal (moving internal components from A to B). In that case, we'll handle them on a case-by-case basis as part of this initiative. However, the primary goal of this task is to move everything with minimal changes—the focus is on the move itself. Significant refactoring will probably be needed, but that should come later through multiple follow-up PRs. We need to work with baby steps so we can move faster, keep PRs small, speed up reviews, and get changes merged more quickly and make it easier the collab. |
Putting aside the question of how to consolidate catalogd and operator-controller, I've had a few more fundamental feelings recently:
I agree with @azych that it might be helpful to look at everything holistically and decide if we can drive some consistency as part of this exercise: Current listing of our internal trees (just directories):
|
Hi @joelanford, The catalogd/internal/version is no longer required, right? We should now use it from oper-con, as both will have the same version. My idea was to consolidate everything since both can use the same libs—only the controllers are specific to one or the other. For those, I was thinking of either adding a prefix to their names or creating a subdirectory to better organize them. The features also could be internal/features/catalogd.go and nternal/features/operator-controller.go. Then, in follow-ups, we can start cleaning things up. However, are you planning to do something like in follow-ups to break more and start by moving it to internal/catalogd for now? Or would you like to keep it there permanently? |
Thinking about the high-level structure and making some basic working assumptions, like:
Making those assumptions, a few concrete ideas that come to mind:
A variation of this could be to just have
|
After going though the existing code I think below structure would be right for the code (It is similar to @azych's suggestion) . It is logical , intuitively easy to understand and sustainable in long term. Also each step needs to be separate PRs, to reduce the chance to human error during doing the change and also during review.
Each movement of code going break existing tests. I am using a VScode plugin [1] which fixes the import path automatically but still unit tests are failing. I am on the fence about whether all controllers should be together in once directory or they should live separately i.e. catalogd controllers in catalogd directory and operator-controller controllers in operator-controller directory. I do not think either way it is bad. Another area is [1] https://marketplace.visualstudio.com/items?itemName=sleistner.vscode-fileutils |
This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
I believe we don’t have anything that is exported today (and likely don’t want to in the future either). Do we really want to encourage using the operator-framework as a library and commit to supporting it long-term? PS: This might make sense if we move forward with @perdasilva’s POC, but at this stage, it feels like premature optimization. That said, I’m not quite sure why we are discussing:
For me, the relevant discussion seems to be focused only on:
What parts of this are truly specific to From my perspective, only the controllers fall into this category. We may need to discuss this further, but do we see any other cases where this applies? Perhaps for certain features, we could introduce specific functionality for one or the other; however, could we not also have the same feature gate for both projects, like I think this is the key point of the discussion that we need to explore.
Then, if ALL is mainly under
PS. I am not big fan of shared dir name |
This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
We discussed it today, and we agreed with the plan: Phase 1: Initial Refactoring
Phase 2: Follow-ups
|
This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
This partially fixes #1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
* Moving version and util to internal/shared This partially fixes #1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]> * Adjusting Makefiles to the new version location Signed-off-by: Lalatendu Mohanty <[email protected]> --------- Signed-off-by: Lalatendu Mohanty <[email protected]>
This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal. This PR does not move catalogd/internal/controllers and catalogd/internal/webhook as it need explict changes in both op-con and catalogd Makefile. Which we will do in a followup PR. catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
…mework#1746) This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal. This PR does not move catalogd/internal/controllers and catalogd/internal/webhook as it need explict changes in both op-con and catalogd Makefile. Which we will do in a followup PR. catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]>
Currently the code of catalogd/internal and operataor-controller/internal exists separately. We need to look in to what we can consolidate in one place i.e. operataor-controller/internal
[1] https://github.com/operator-framework/operator-controller/tree/main/catalogd/internal
[2] https://github.com/operator-framework/operator-controller/tree/main/internal
The text was updated successfully, but these errors were encountered: