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

Malformed can-i URL on non-kubeapps cluster #2719

Closed
antgamdia opened this issue Apr 27, 2021 · 0 comments · Fixed by #3960
Closed

Malformed can-i URL on non-kubeapps cluster #2719

antgamdia opened this issue Apr 27, 2021 · 0 comments · Fixed by #3960
Assignees
Labels
component/kubeops Issue related to kubeops (to be deprecated) good first issue kind/bug An issue that reports a defect in an existing feature
Projects

Comments

@antgamdia
Copy link
Contributor

antgamdia commented Apr 27, 2021

Description:

405 errors are thrown when hitting the can-i URL in the cluster in which Kubeapps in installed on, but without declaring it under the clusters: object in the values.yaml.
It results in a currentCluster == "", so when building the URL, the empty is passed through.

There is -no- UX impact, but it generates unexpected calls in Kubeops depending upon the browser.

  1. performs a POST request to api/v1/clusters//can-i
  2. got a 301 redirect to api/v1/clusters/can-i
  3. browser (ignoring the RFC) changes the POST to a GET method
  4. kubeops receives GET api/v1/clusters/can-i, returning a 405 method not allowed

Steps to reproduce the issue:

  1. Configure Kubeapps so that users can target a second cluster and not target the cluster on which Kubeapps is installed,
  2. Click on the AppRepositories menu item
  3. See the network inspector

Describe the results you received:

405 status code response.

Describe the results you expected:

Either:

I) a 200 OK with authorized: no (since it using the serviceaccount, not the user account) (I'd go for this one)
ii) another meaningful and handled HTTP status code.

However, note that not generating a proper response for this case (requestedCluster=="") it will generate a 401 response, so users will get logged out each time they click on app-repositories.

Version of Helm, Kubeapps and Kubernetes:

devel Kubeapps

Originally posted by @antgamdia in #2712 (comment)

@project-bot project-bot bot added this to Inbox in Kubeapps Apr 27, 2021
@antgamdia antgamdia added component/ui Issue related to kubeapps UI component/kubeops Issue related to kubeops (to be deprecated) size/S and removed component/ui Issue related to kubeapps UI labels Apr 27, 2021
@ppbaena ppbaena added the kind/bug An issue that reports a defect in an existing feature label May 10, 2021
@ppbaena ppbaena moved this from Inbox to Backlog in Kubeapps May 10, 2021
@ppbaena ppbaena moved this from Backlog to Next iteration discussion in Kubeapps Jun 7, 2021
@ppbaena ppbaena moved this from Next iteration discussion to Backlog in Kubeapps Jul 5, 2021
@ppbaena ppbaena added this to the Technical debt milestone Sep 24, 2021
@castelblanque castelblanque self-assigned this Dec 10, 2021
@castelblanque castelblanque moved this from Backlog to In progress in Kubeapps Dec 10, 2021
castelblanque pushed a commit that referenced this issue Dec 15, 2021
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
@castelblanque castelblanque moved this from In progress to Waiting For Review in Kubeapps Dec 15, 2021
Kubeapps automation moved this from Waiting For Review to Done Dec 15, 2021
castelblanque added a commit that referenced this issue Dec 15, 2021
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/kubeops Issue related to kubeops (to be deprecated) good first issue kind/bug An issue that reports a defect in an existing feature
Projects
No open projects
Kubeapps
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants