Skip to content
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

[Hosted Che] OpenShift Connector plugin does not work properly #16890

Closed
ibuziuk opened this issue May 11, 2020 · 15 comments · Fixed by che-incubator/che-theia-openshift-auth#3
Closed
Assignees
Labels
area/hosted-che area/plugins kind/task Internal things, technical debt, and to-do tasks to be performed. severity/P1 Has a major impact to usage or development of the system.

Comments

@ibuziuk
Copy link
Member

ibuziuk commented May 11, 2020

Is your task related to a problem? Please describe.

As part of redhat-developer/rh-che#1832 we would like to enable the OpenShift Connector for every single workspace on Hosted Che. However, there are a couple of things that need to be fixed first:

image

Describe the solution you'd like

OpenShift Connector plugin works properly on Hosted Che - console link is displayed correctly + user is logged to the user namespace by default.

@ibuziuk ibuziuk added kind/task Internal things, technical debt, and to-do tasks to be performed. severity/P1 Has a major impact to usage or development of the system. area/hosted-che area/plugins labels May 11, 2020
@ibuziuk
Copy link
Member Author

ibuziuk commented May 11, 2020

@ericwill could you please take a look and try openshift connector flow on Hosted Che?

@l0rd
Copy link
Contributor

l0rd commented May 11, 2020

cc @vinokurig

@vinokurig
Copy link
Contributor

For changing the cluster link changes in the upstream plugin project are required. To apply auto login we can add the related functionality to our openshift oauth plugin

@vinokurig
Copy link
Contributor

But we would still need to ask the openshift username because it may be different from Che username.

@gorkem
Copy link
Contributor

gorkem commented May 26, 2020

This behavior is the expected behavior for tools like kubectl and derivatives. These tools detect the context when inside a cluster using environment variables such as KUBERNETES_SERVICE_PORT, KUBERNETES_PORT, KUBERNETES_SERVICE_HOST. You can see all of those if you do a env | grep KUBE on the workspace.

The namespace and token comes from /var/run/secrets/kubernetes.io/serviceaccount/*.

I think the problem with the console URL is going to correct itself on a 4.x cluster because openshift extension has corrected the changed behavior which should cover incluster case for 4.x too.

@ibuziuk
Copy link
Member Author

ibuziuk commented Jun 1, 2020

Based on the discussion in the #17020 openshift oauth plugin from che-incubator is using Authorization: Bearer <user token>' https://che.openshift.io/api/oauth/token?oauth_provider=openshift

@vinokurig for Hosted Che it should be possible to use https://auth.openshift.io/api/token?for=openshift that will provide the cluster url, token & username

@vinokurig
Copy link
Contributor

@ibuziuk thanks, your request works!

@ibuziuk
Copy link
Member Author

ibuziuk commented Jun 23, 2020

@ericwill @vinokurig there is a PR opened eclipse-che/che-theia#773 can we have this merged in 7.15.0 ?

@ibuziuk ibuziuk mentioned this issue Jun 24, 2020
13 tasks
@ibuziuk
Copy link
Member Author

ibuziuk commented Jun 24, 2020

FYI this issue blocks redhat-developer/rh-che#1832 at this point of time

@vinokurig
Copy link
Contributor

depends on #17332

@vinokurig vinokurig added the status/blocked Issue that can’t be moved forward. Must include a comment on the reason for the blockage. label Jul 6, 2020
@azatsarynnyy
Copy link
Member

@vinokurig could you please clarify a bit more how exactly it depends on #17332?

@vinokurig
Copy link
Contributor

@azatsarynnyy

could you please clarify a bit more how exactly it depends on #17332?

To fix it I've added getUser() Plugin API function (eclipse-che/che-theia#784). To apply it in the OpenShift oauth plugin the sources must be updated in the npm registry: https://www.npmjs.com/package/@eclipse-che/plugin. AFAIK this build invokes the npm build of the @eclipse-che/plugin module.

@azatsarynnyy
Copy link
Member

I see. Thanks @vinokurig
We're looking at #17332 now.

@azatsarynnyy
Copy link
Member

@vinokurig done, @eclipse-che/plugin is updated

@vinokurig
Copy link
Contributor

@azatsarynnyy Nice!, Thank you

@vinokurig vinokurig removed the status/blocked Issue that can’t be moved forward. Must include a comment on the reason for the blockage. label Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hosted-che area/plugins kind/task Internal things, technical debt, and to-do tasks to be performed. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants