Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1414691 - Name validation is not consistent in cli with from web console
Name validation is not consistent in cli with from web console
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console (Show other bugs)
3.5.0
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Samuel Padgett
Yadan Pei
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-01-19 04:16 EST by Yanping Zhang
Modified: 2017-07-24 10 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
When creating some resources in the web console, the validation of the name field was more strict than the command-line interface. Validation has been relaxed for the following forms in the web console to match the command line: * Add Autoscaler * Add Storage * Create Config Map * Create Route * Create Secret Periods are now allowed in the names, and the max length has been increased to 253 characters.
Story Points: ---
Clone Of:
: 1414956 (view as bug list)
Environment:
Last Closed: 2017-04-12 15:09:58 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0884 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.5 RPM Release Advisory 2017-04-12 18:50:07 EDT

  None (edit)
Description Yanping Zhang 2017-01-19 04:16:06 EST
Description of problem:
When create pvc from storage page on web console, if input pvc name containing "." such as "pvc.test", it will prompt error info:"Claim names may only contain lower-case letters, numbers, and dashes. They may not start or end with a dash. Max length of 253.", but pvc with name "pvc.test" can be created successfully in cli.

Version-Release number of selected component (if applicable):
openshift v3.5.0.6+87f6173
oc v3.5.0.6+87f6173

How reproducible:
Always

Steps to Reproduce:
1.Create pvc with name containing "." such as "pvc.test" from storage page on web console.
2.Create pvc with name containing "." in cli.
$ cat pvc-one.json 
{
    "apiVersion": "v1",
    "kind": "PersistentVolumeClaim",
    "metadata": {
        "name": "pvc.test"
    },
    "spec": {
        "accessModes": [ "ReadWriteOnce" ],
        "resources": {
            "requests": {
                "storage": "2Gi"
            }
        }
    }
}
$ oc create -f pvc-one.json 
persistentvolumeclaim "pvc.test" created
$ oc get pvc
NAME       STATUS    VOLUME    CAPACITY   ACCESSMODES   AGE
pvc.test   Pending                                      6s

3.

Actual results:
1.Could not create pvc.test on web console.
2.Could create pvc.test in cli successfully.

Expected results:
1,2.Should have consistent validation about pvc name from web console and cli.

Additional info:
Creating other resources have same issue, too. eg: route.
Comment 1 Jessica Forrester 2017-01-19 14:53:14 EST
Routes shouldn't be allowing the '.', cloned a bug to Routing component to resolve that issue https://bugzilla.redhat.com/show_bug.cgi?id=1414956

The remaining issues are with the console being too strict in its validation.
Comment 2 Samuel Padgett 2017-01-20 15:31:55 EST
We're updating name validation (pattern and maxlength) on the following forms:

* Add Autoscaler
* Add Storage
* Create Config Map
* Create Route
* Create Secret

Suggest regression testing these forms.

https://github.com/openshift/origin-web-console/pull/1155
Comment 3 openshift-github-bot 2017-01-20 15:43:02 EST
Commit pushed to master at https://github.com/openshift/origin-web-console

https://github.com/openshift/origin-web-console/commit/96fcca36402973bc933a5a78da29673cb16a957b
Bug 1414691 - Fix name validation for several resources
Comment 4 Troy Dawson 2017-01-27 12:42:34 EST
This has been merged into ocp and is in OCP v3.5.0.10 or newer.
Comment 5 Yanping Zhang 2017-02-03 01:04:00 EST
Tested on OCP v3.5.0.14 :
Create "Autoscaler","Storage","Config Map","Route" and "Secret" from web console, when name is invalid, there is error info showing:
"Name must consist of lower-case letters, numbers, periods, and hyphens. It must start and end with a letter or a number. "
And name containing ".","-" such as "name.test-one" is valid, and could be created successfully both from cli and web.
The bug has been fixed, so move it to Verified.
Comment 7 errata-xmlrpc 2017-04-12 15:09:58 EDT
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-2017:0884

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