-
Notifications
You must be signed in to change notification settings - Fork 53
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
Fix kube config flow #562
Fix kube config flow #562
Conversation
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Skipping CI for Draft Pull Request. |
Codecov Report
@@ Coverage Diff @@
## main #562 +/- ##
==========================================
+ Coverage 56.14% 56.23% +0.08%
==========================================
Files 216 217 +1
Lines 7385 7375 -10
Branches 1262 1265 +3
==========================================
+ Hits 4146 4147 +1
+ Misses 3060 3049 -11
Partials 179 179
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-562 |
packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts
Outdated
Show resolved
Hide resolved
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.
tested locally against dogfooding and there is one thing I can not grok:
bash-4.4$ cat ~/.kube/config
{"apiVersion":"v1","kind":"Config","clusters":[{"name":"api-che-dev-x6e0-p1-openshiftapps-com:6443","cluster":{"server":"https://api.che-dev.x6e0.p1.openshiftapps.com:6443","insecure-skip-tls-verify":false}}],"users":[{"name":"developer","user":{"token":"<token>"}}],"contexts":[{"name":"logged-user","context":{"user":"developer","cluster":"api-che-dev-x6e0-p1-openshiftapps-com:6443","name":"logged-user"}}],"preferences":{},"current-context":"logged-user"}
bash-4.4$ oc whoami
ibuziuk
Basically, oc whoami
reports the right user, but the kube config file refers to the developer
user. wondering if this is expected? Basically, the token that is injected in file is the correct one and belongs to my user, but it is a bit strange to see the developer
reference.
@akurinnoy thanks for the pointer https://github.com/eclipse-che/che-dashboard/blob/main/packages/dashboard-backend/src/services/kubeclient/kubeConfigProvider.ts#L39-L46 looks like the logic for retrieving the username is failing atm. Can be fixed in a separate PR though |
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 👍
the problem with username detection can be fixed in a separate PR I believe. I think we should not fall back on token itself for username since it is a sha256 one-way hash that can not be decrypted.
Signed-off-by: Oleksii Orel <oorel@redhat.com>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: akurinnoy, ibuziuk, olexii4 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-562 |
@olexii4: 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. |
Thanks @olexii4 for the rapid fix. I am not sure if it's even necessary to get the right username. It looks like the only important thing is the token anyway. |
Signed-off-by: Oleksii Orel oorel@redhat.com
What does this PR do?
Fix kube config flow
What issues does this PR fix or reference?
fixes eclipse-che/che#21454
Is it tested? How?
config
file should be in~/.kube/
You can test it with https://eclipse-che.apps.cluster-k865s.k865s.sandbox811.opentlc.com