-
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
Remove need to be connected to a cluster to create a component #3825
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont see anything with the code.
However, the tests seem to have cancelled by user?
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cdrage The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
Worked for me on a openshift cluster even after logging out. But in case of minikube, after shutdown, I faced this problem
|
I've tested it without problem with kind… |
These are the steps that I ran
|
Going to check. |
@mik-dass I've looked into it and this has not much to do with the change, this is due to changes made for #3938: link command now checks if CSV is supported when the command is created which, in my opinion, is wrong because creating commands should only be about initializing the hierarchy of commands and nothing more. The consequence of that change is that a completely unrelated command (link) makes create fail. Generally speaking, we should keep to the Complete/Validate/Run pattern as much as possible and complete the commands' options in Complete instead of doing it either when creating the Options or even before. /cc @dharmit @kadel |
First off, thank you for a PR to make
Ah, my change has lead to other troubles. However, I didn't find a better place for the change I made in that PR. 😞
But in this particular case, we are setting the cobra Besides that, you're suggesting changing the implementation for all the commands, right? I'm talking about the suggestion to complete the commands' options in |
Faster is only a side-effect: the primary goal is to be able to work with odo without needing a cluster access until I actually want to push the code and see it running on the cluster.
Yes, I understand why it was made but I'm not sure it should made… 😄 From an implementation perspective, it's a bad idea as evidenced with this issue: an unrelated command (in this case,
Ultimately, yes. Tactically, I need at least |
+1. Avoiding connecting to cluster is exactly what I was thinking when I encountered slowness of
Makes sense, actually. We could elaborate on the web based docs about different use cases supported by the command.
+1. That's a bad UX choice made by me. In my defence, I did what I did because
For what's currently blocking you, as I mentioned, I'll open an issue and try to address this soon so that it unblocks you. But for the suggested change in overall implementation/design, I request you to open an issue so that it doesn't get lost in the discussion for just this PR. |
Inline help shouldn't be a substitute for documentation. I don't think that overloading the inline help would help. Maybe we'd be better served creating
👍 |
We're not trying to do this on purpose. But looking at where things are with few commands, and especially @metacosm I was stepping over the code based on the steps mentioned in #3825 (comment). What I found is that the failure is attributed to missing kubeconfig context. If a user does I don't find a call to the CSV part of #3938 while doing |
I know. The issue is that
The call happens when the |
Note that this fix is negated by the cluster access that's being done in the NewCmdLink function, which means that the cluster is accessed when the command is created even if it's not being called so without a proper solution to remove this access, we won't be able to fix create.
@metacosm: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
rebase needed |
The current code is not going to work as it is because there are too many parts that rely on an exposed kubernetes client and quite frankly I don't feel like fixing all of them at this point, at least, not before a true effort is made to fix the architecture. Nor do I want to introduce more if/else code to handle all the edge cases. /cc @kadel |
so should we close this PR and try to resolve this issue systematically by first considering the architecture? |
It depends on how important the underlying issue is (my opinion: it's very important from a middleware perspective). Fixing the architecture will be a significant undertaking… My problem with this issue is that I don't quite understand why there are 2 clients (oc and plain k8s) instead of just one. I tried to address that but apparently client code won't accommodate a single client because the logic is different depending on which client is initialized, which just doesn't make any sense to me… So I don't feel I'm qualified to fix the remaining issues in a reasonable amount of time. |
@dev-gaur See #3825 (comment) for my perspective on this |
See #4057 for more details on what I think should be done, architecture-wise. |
should we close this PR as it seems solving this issue would take an architectural overhaul ( which is happening right now )? |
closing this PR as a major architectural overhaul is underway |
What type of PR is this?
/kind bug
What does does this PR do / why we need it:
This PR delays the need to connect to a cluster until it's actually needed. This is accomplished by:
This is required for
odo create
to work without being connected to a cluster.Which issue(s) this PR fixes:
Fixes #3811
PR acceptance criteria:
Unit test
Integration test
Documentation
I have read the test guidelines
How to test changes / Special notes to the reviewer:
odo create
would fail if not connected to a cluster before this PR.odo create
should work even when not connected after.