-
Notifications
You must be signed in to change notification settings - Fork 243
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
Refactor occlient and kclient by unifying them into one #4093
Comments
We need to primarily bring back the original 3 layered architecture that odo had -
Currently things are bleading into each other. |
It might be good idea to merge the two clients into a single client which handles both openshift and kubenetes clusters. We already are using the kclient inside the occlient This will help reduce duplicate code between the two clients. Also a single interface for both the clients might be tricky as certain resources like routes etc are not in the kclient. |
I remember that we started |
We will just remove the unnecessary functions when that deprecation happens from the new merged client. Also creation of routes instead of ingress does need a occlient currently and we need to support s2i for some time. |
The two clients should be indeed be merged. It shouldn't matter to the client code which kind of cluster odo is connected to. I don't think that this can be done without first isolating how components / etc. are realized on the cluster from code calling it: i.e. code calling the client shouldn't need to know how a component is implemented on the cluster. More precisely, the client should expose something like |
We were thinking of doing this on the odo specific packages. The current idea is to have interfaces for storage, URL etc and s2i/devfile will have their own implementations of those functions. The client won't have any idea about odo specific things. |
I have added a document regarding the refactor here https://docs.google.com/document/d/1izxse1fBKqWG1822zvSsZwZHTDj57nlxlZllLxpDfzI/edit?usp=sharing. @metacosm @kadel @girishramnani @adisky @dharmit Please have a look and share your feedback. |
@mik-dass I've added some comments, please also see: #4057 (comment) |
Resources to be moved and cleaned up from the occlient and kclient
Other tasks include clean up files, clean up interfaces like ExecClient to reduce import cycles and remove duplicate functions. |
@mik-dass can you move this into the issue description and check off the ones you have already got merged? Add a note to those that have a PR open. Just want to get an idea about its status before we consider it for the next sprint. And, if all the resources have been taken care, feel free to close this! |
I have checked off the resources which are done.
We need to finish this part and unify the two clients. |
So now we're supposed to make changes that we discussed in #4057? I remember you were working on url package to make it more interface-y. Are you planning to open a PR for it or have you abondoned that code? For things in "odo service" and "odo catalog list services", I intend to address those via #4242. |
Yes, the client related changes discussed in #4057.
I need to clean it up as a part of #4115. |
/kind code-refactoring
Acceptance Criteria
oc client and kclient should have the same interface and based on what odo encounters in the context, the client needs to be decided in the context.occlient
andkclient
into one client called askclient
. Remove the duplications and do everything throughkclient
. Interfaces to be added later.The text was updated successfully, but these errors were encountered: