Bug 1962153

Summary: VolumeSnapshot routes are ambiguous, too generic
Product: OpenShift Container Platform Reporter: Joel Takvorian <jtakvori>
Component: Management ConsoleAssignee: Joel Takvorian <jtakvori>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.8CC: aos-bugs, jhadvig, jokerman, spadgett, yapei
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-27 23:09:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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.