-
Notifications
You must be signed in to change notification settings - Fork 594
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
CONSOLE-3323: Switch to admin perspective when user navigates directly to a cluster-scoped route and is in the "All Clusters" perspective #12254
Conversation
@TheRealJon: This pull request references Bugzilla bug 2075654, which is invalid:
Comment In response to this:
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. |
/bugzilla refresh |
@TheRealJon: This pull request references Bugzilla bug 2075654, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
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. |
frontend/packages/console-app/src/components/detect-perspective/DetectPerspective.tsx
Outdated
Show resolved
Hide resolved
@TheRealJon: No Bugzilla bug is referenced in the title of this pull request. In response to this:
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. |
/label tide/merge-method-squash |
Hmm so the |
… to a cluster-scoped route and is in the "All Clusters" perspective
Fixed. |
QE Approver Docs Approver: PX Approver: |
/label px-approved |
/label docs-approved |
/retest |
/retest |
/retest |
/test e2e-gcp-console |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhamilto, TheRealJon 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 |
/retest |
@TheRealJon: all tests passed! 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. |
'/dashboards', | ||
'/settings', | ||
'/api-explorer', | ||
'/catalog', |
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.
/catalog
route is in dev perspective
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.
also do we need list all cluster-scope URL here? it looks like some URLs are missing here, for example if I go to following URLs , I will still stay in ACM perspective
/k8s/cluster/core~v1~Namespace
/k8s/cluster/apiextensions.k8s.io~v1~CustomResourceDefinition
/k8s/cluster/config.openshift.io~v1~Infrastructure/cluster
/hold Rethinking how we can solve this issue. I don't think it's safe to assume single/multi cluster context from navigation routes. |
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.
@TheRealJon What is the scenario here? You're in the "All Clusters" perspective and someone sends you a link? Or do you have to manually edit the URL?
const clusterRouteMatch = useRouteMatch({ path: CLUSTER_SCOPED_ROUTES }); | ||
const isMulticlusterPerspective = activePerspective === 'acm'; | ||
const overrideClusterScope = !perspectiveParam && clusterRouteMatch && isMulticlusterPerspective; | ||
const overridePerspective = overrideClusterScope ? 'admin' : perspectiveParam; |
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.
Note that the admin perspective can be disabled in the cluster config.
@@ -33,6 +33,17 @@ export const namespacedPrefixes = [ | |||
'/status', | |||
]; | |||
|
|||
export const CLUSTER_SCOPED_ROUTES = [ |
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.
I worry about having a hard-coded list of paths that we need to maintain. It also means we won't be able to support routes contributed by plugins.
My thought was to switch the current cluster to local-cluster when using All Clusters, so that ACM links out to console pages will be for the correct cluster. But I suppose if you followed a link to an ACM page, the perspective doesn't change automatically, so my approach would leave that gap. |
We've decided against this approach for handling cluster context for now. We may need to revisit, but for now, I will close this PR. |
When manually navigating to a known cluster-scoped route, the console will automatically switch to the admin perspective so that the active cluster context is clear.