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

fix: Application page "permission denied" when navigating between applications in different namespaces #17800

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sir-Jacques
Copy link

@Sir-Jacques Sir-Jacques commented Apr 10, 2024

This PR contains a proposed bugfix for a navigation bug which happens when navigating through the application-searchbar on top of the application-details page. When navigating to an application that is in another namespace on the kubernetes cluster, it will use the wrong url (/applications/xxxx instead of /applications/namespace/xxxx). With the fix to the ApplicationsDetailsAppDropdown, it navigates to the correct browser URL. Although the URL is correct it only loads the page after physically refreshing due to the next observation I came across.

In addition to the browser URLs being incorrectly constructed, I found that when navigating, the ApplicationDetails constructor does NOT run before the render function starts building the ObservableQuery. This means it keeps using the this.appNamespace from the previous page (it is not getting updated) to retrieve the application data. I'm very new to React so I have not been able to find out why. A workaround for this was to use the this.props.match.params.name directly instead of relying on the constructor to update the this.appNamespace. There must be a nicer way to do this? Any suggestions are welcome!

Checklist:

  • [V] Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • [V] The title of the PR states what changed and the related issues number (used for the release note).
  • [V] The title of the PR conforms to the Toolchain Guide
  • [V] I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • [-] I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • [-] Does this PR require documentation updates?
  • [-] I've updated documentation as required by this PR.
  • [V] I have signed off all my commits as required by DCO
  • [-] I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • [-] My build is green (troubleshooting builds).
  • [V] My new feature complies with the feature status guidelines.
  • [V] I have added a brief description of why this PR is necessary and/or what this PR solves.
  • [-] Optional. My organization is added to USERS.md.
  • [-] Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

Fixes #17781

@Sir-Jacques Sir-Jacques requested a review from a team as a code owner April 10, 2024 17:44
@Sir-Jacques Sir-Jacques changed the title fix: Namespaced applications "permission denied" when navigating between application-details fix: Application page "permission denied" when navigating between applications in different namespaces Apr 10, 2024
@Sir-Jacques Sir-Jacques force-pushed the bugfix-navigation-bug-between-namespaced-apps branch from 9493e5c to fd39c3e Compare April 11, 2024 10:26
Signed-off-by: jacco <jaccomook.98@gmail.com>
@Sir-Jacques Sir-Jacques force-pushed the bugfix-navigation-bug-between-namespaced-apps branch from fd39c3e to 591ab15 Compare April 11, 2024 11:51
@woehrl01
Copy link
Contributor

Thank you @Sir-Jacques for that fix! I pushed a PR to your branch to also fix the UI part so that the namespace is shown as well in the search and some other fixes around that. See Sir-Jacques#1 this fixes #17781 completely for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI: Inconsistent behaviour / permission denied with "App in any namespace"
2 participants