Bug 1388043

Summary: [userinterface_public_502] Escape characters in error message look messy when editing membership
Product: OpenShift Container Platform Reporter: Xingxing Xia <xxia>
Component: Management ConsoleAssignee: bpeterse
Status: CLOSED CURRENTRELEASE QA Contact: Yadan Pei <yapei>
Severity: low Docs Contact:
Priority: low    
Version: 3.4.0CC: aos-bugs, jforrest, jokerman, mmccomas, spadgett, tdawson, xiaocwan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-13 15:27:25 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 Xingxing Xia 2016-10-24 09:58:58 UTC
Description of problem:
Escape characters in error message look messy when editing membership

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

How reproducible:
Always

Steps to Reproduce:
1. Login with admin user
2. Go to "Resources" -> "Membership", click "Edit Membership"
3. Add role to user: input invalid user name "user/abc", select role "view", then click "Add"
4. Add cluster-admin to user: select the option "Show hidden roles
", input user name "bob", select "cluster-admin", click "Add"

Actual results:
Step 3 and 4, the error message includes escape characters like '&quot;':
3.
The role "view" was not given to "user/abc".Reason: "RoleBinding &quot;view&quot; is invalid: [subjects[1].name: Invalid value: &quot;user/1&quot;: name may not contain &quot;/&quot;, subjects[2].name: Invalid value: &quot;xxia-proj/bob*abc&quot;: must match the regex [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* (e.g. &#39;example.com&#39;), subjects[3].name: Invalid value: &quot;user/abc&quot;: name may not contain &quot;/&quot;]"

4.
The role "cluster-admin" was not given to "xxia12345678901234567890123456789012345678901234567890".Reason: "rolebinding &quot;cluster-admin&quot; is forbidden: user &quot;xxia&quot; cannot grant extra privileges: {Verbs:[&quot;*&quot;], APIGroups:[&quot;*&quot;], Resources:[&quot;*&quot;]} {Verbs:[&quot;*&quot;], NonResourceURLs:[&quot;*&quot;]}"

Expected results:
3 and 4 should look well in error message.

Additional info:

Comment 1 Xingxing Xia 2016-10-24 10:42:53 UTC
There may be many similar situations that are not known until encountered.
E.g. here is another situation:
Leave user name input empty, select role "view", click 'Add' (gray!), the error message also includes escape characters:
The role "view" was not given to "".Reason: "RoleBinding &quot;view&quot; is invalid: subjects[1].name: Required value"

Comment 2 Xingxing Xia 2016-10-24 10:45:25 UTC
In comment 1, the gray button 'Add' can be clicked (thus produces the error message). It should not be clicked, this is another problem. Will use a new bug to report it

Comment 3 bpeterse 2016-10-24 21:16:47 UTC
PR open for this: https://github.com/openshift/origin-web-console/pull/718

Comment 5 Troy Dawson 2016-11-02 17:58:38 UTC
This has been merged into ose and is in OSE v3.4.0.19 or newer.

Comment 7 XiaochuanWang 2016-11-03 09:14:13 UTC
Verified on latest origin
openshift v1.4.0-alpha.0+90d8c62-1000-dirty
Follow original test steps and it's not reproduced. The special characters will not be treated as invalid name, it'll be the part of user name.