Bug 1962153 - VolumeSnapshot routes are ambiguous, too generic
Summary: VolumeSnapshot routes are ambiguous, too generic
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.8
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.8.0
Assignee: Joel Takvorian
QA Contact: Yadan Pei
Depends On:
TreeView+ depends on / blocked
Reported: 2021-05-19 11:58 UTC by Joel Takvorian
Modified: 2021-07-27 23:09 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Last Closed: 2021-07-27 23:09:14 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github openshift console pull 8979 0 None open Bug 1962153: fix VolumeSnapshot routes 2021-05-19 15:39:40 UTC
Red Hat Product Errata RHSA-2021:2438 0 None None None 2021-07-27 23:09:36 UTC

Description Joel Takvorian 2021-05-19 11:58:21 UTC
Description of problem:

The 3 react routes defined for VolumeSnapshot [1] are ambiguous / potentially malformed, they are generic though targeting a specific component. Because of that, they might take precedence over a route defined for another component, and show the wrong component instead of the expected one.

The problem happened to Yadan Pei while testing another feature, https://github.com/openshift/console/pull/8655 : the route "/k8s/ns/yapei/networkpolicies/~new/form" happens to be routed from template "/k8s/ns/:ns/:plural/~new/form" (defined for VolumeSnapshot) instead of the expected "/k8s/ns/:ns/networkpolicies/~new/form" (defined for NetworkPolicy)

Note that the issue hasn't been always reproducible (I actually didn't reproduce it myself), but the issue that Yadan Pei had while testing my PR pointed me to that direction. To this date I don't know what makes it reproducible or not.

[1] https://github.com/openshift/console/blob/df2216d3e3fab8768ce4e0ea3e00dbe032f74e99/frontend/public/components/app-contents.tsx#L451-L479

Version-Release number of selected component (if applicable):


How reproducible:

See above: don't know

Actual results:

Link /k8s/ns/namespace/whatever/~new/form sometimes routed to VolumeSnapshot

Expected results:

Link /k8s/ns/namespace/whatever/~new/form always routed to whatever's component

Additional info:

I'll provide a quick & dirty fix as a workaround in my PR for network policies ( https://github.com/openshift/console/pull/8655 ), however, while investigating I found the problem to be more complex than expected to fix in a clean way, thus I'm writing this ticket.

Comment 1 Joel Takvorian 2021-05-19 12:48:25 UTC
There's another problem caused by the VolumeSnapshot routes: when a snapshot is being created from a PVC (from PVC details > Actions > Create snapshot), then click on "Edit YAML" link, it redirects to the PVC YAML edition instead of the VolumeSnapshot YAML edition.

Unlike the problem described above, this problem is a bug actually visible on master branch.

Comment 3 Yadan Pei 2021-06-01 05:40:36 UTC
1. build bridge from latest master branch and bridge to running cluster, /k8s/ns/yapei/networkpolicies/~new/form is linking to network policy creation form
2. also create snapshot from PVC details > Actions > Create snapshot, then click on "Edit YAML" link, it redirects to the VolumeSnapshot YAML page.

pages are redirected correctly, verified on 4.8.0-0.nightly-2021-05-31-190546

Comment 6 errata-xmlrpc 2021-07-27 23:09:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.