Bug 1688613

Summary: Avoid duplicate error message for failed validation
Product: OpenShift Container Platform Reporter: Yadan Pei <yapei>
Component: Dev ConsoleAssignee: cvogt
Status: CLOSED ERRATA QA Contact: Ruchir Garg <rgarg>
Severity: low Docs Contact:
Priority: medium    
Version: 4.1.0CC: aos-bugs, jokerman, mmccomas, nmukherj
Target Milestone: ---   
Target Release: 4.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Feature: When the introduction of the Developer console, some forms have been overhauled. Some fields, such as the name, now use client side validation to provide immediate feedback for invalid values. Reason: Error messages from the server are often long and unclear. Result: Client side validation will show an inline error message for invalid name values.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-23 11:03:45 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:
Embargoed:
Attachments:
Description Flags
name validation error none

Description Yadan Pei 2019-03-14 05:42:15 UTC
Description of problem:


Version-Release number of selected component (if applicable):
cluster version: 4.0.0-0.nightly-2019-03-13-233958
console commit: ddab4c4d3863f4472819b208493fae871968e641

How reproducible:
Always

Steps to Reproduce:
1. user create application from image following these steps
Catalog -> Developer Catalog -> php -> fill required fields and set Name as invalid inputs, such as R#%@TWTYGY -> hit Create


Actual results:
1. Long and duplicate error message shown on page:
Error "Invalid value: "r#%@twtygy": may not contain '%'" for field "metadata.name".; Error "Invalid value: "r#%@twtygy": a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')" for field "metadata.name".; Error "Invalid value: "r#%@twtygy": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')" for field "metadata.name".; Error "Invalid value: "r#%@twtygy": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')" for field "metadata.name".; Error "Invalid value: "r#%@twtygy": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')" for field "metadata.name".

Expected results:
1. Clear error message should be shown and only once

Additional info:

Comment 1 Samuel Padgett 2019-10-28 18:08:43 UTC
Updating to dev console since the code has moved. It looks like this might have been fixed indirectly since it was opened.

Comment 2 cvogt 2019-11-07 14:59:57 UTC
No longer reproducible as the forms have changed and include name validation that prevents the creation of the resource.

Comment 3 cvogt 2019-11-23 01:31:43 UTC
Created attachment 1638956 [details]
name validation error

Comment 4 cvogt 2019-11-23 01:32:12 UTC
Verified on: https://openshift-release.svc.ci.openshift.org/releasestream/4.3.0-0.ci/release/4.3.0-0.ci-2019-11-22-122829

Firefox: 68.2.0esr

As noted previously, the name now has validation client side. See attached screenshot.

Comment 6 errata-xmlrpc 2020-01-23 11:03:45 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, 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/RHBA-2020:0062