Bug 2083756 - Linkify not upgradeable message on ClusterSettings page
Summary: Linkify not upgradeable message on ClusterSettings page
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.11
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: 4.11.0
Assignee: Robb Hamilton
QA Contact: Yanping Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-10 17:27 UTC by Samuel Padgett
Modified: 2022-08-10 11:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Version: 4.11.0-0.nightly-2022-05-09-224745 Cluster ID: 48ab4c6c-f91a-4aeb-8c2c-ae89936076d7 Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36
Last Closed: 2022-08-10 11:11:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Screenshot (251.95 KB, image/png)
2022-05-10 17:27 UTC, Samuel Padgett
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 11490 0 None open Bug 2083756: enable simplifiedAutoLink for ClusterNotUpgradeableAlert 2022-05-12 18:38:53 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 11:11:19 UTC

Description Samuel Padgett 2022-05-10 17:27:44 UTC
Created attachment 1878378 [details]
Screenshot

The cluster settings page shows a message when the cluster is no upgradeable. Sometimes this message contains URLs, which we should turn into links in the UI with the Linkify component. Example message:

"Kubernetes 1.25 and therefore OpenShift 4.12 remove several APIs which require admin consideration. Please see the knowledge article https://access.redhat.com/articles/6955381 for details and instructions."

(See screenshot.)

Comment 1 Robb Hamilton 2022-05-11 11:47:07 UTC
The existing behavior is to pass the content to SyncMarkdownView (see https://github.com/openshift/console/blob/5aebdf4faa6e050e5c4db83095739f71a303d6ef/frontend/public/components/cluster-settings/cluster-settings.tsx#L950) as the content can contain markdown.  I don't think SyncMarkdownView and Linkify are compatible?

Comment 2 Samuel Padgett 2022-05-12 14:34:18 UTC
Hm, it looks like showdown has an auto link option we could try:

https://github.com/showdownjs/showdown

simplifiedAutoLink: (boolean) [default false] Turning this option on will enable automatic linking to urls. This means that:

some text www.google.com
will be parsed as

<p>some text <a href="www.google.com">www.google.com</a>

Although if the message is meant to be markdown, it would be better to include <> angle brackets around the URL in the message itself, then it should just work.

Comment 4 Yanping Zhang 2022-05-17 12:25:42 UTC
Checked on ocp 4.11 cluster with payload 4.11.0-0.nightly-2022-05-17-060006.
Steps to verify:
1.Construct fake message containing 3 types of links from clusteroperator for testing.
$ cat <<EOF >co.yaml 
apiVersion: config.openshift.io/v1
kind: ClusterOperator
metadata:
  name: testing
spec: {}
EOF
$ oc apply -f co.yaml
$ oc proxy &
$ curl -k -XPATCH -H "Accept: application/json" -H "Content-Type: application/json-patch+json" 'http://127.0.0.1:8001/apis/config.openshift.io/v1/clusteroperators/testing/status' -d '[{"op": "add", "path": "/status", "value": {"conditions": [{"lastTransitionTime": "2021-06-01T01:01:01Z", "type": "Upgradeable", "status": "False", "reason": "Testing", "message": "The whatsits are broken.Pls refer to: 1. http://www.example.com 2. <http://www.example.com> 3. [http://www.baidu.com](http://www.baidu.com)"}]}}]'
2. Check on clustersettings details page. The 3 types of links could be shown and open correctly. Pls see screenshot.

The bug is fixed.

Comment 7 errata-xmlrpc 2022-08-10 11:11:01 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 (Important: OpenShift Container Platform 4.11.0 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.

https://access.redhat.com/errata/RHSA-2022:5069


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