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):
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
"accessModes": [ "ReadWriteOnce" ],
$ oc create -f pvc-one.json
persistentvolumeclaim "pvc.test" created
$ oc get pvc
NAME STATUS VOLUME CAPACITY ACCESSMODES AGE
pvc.test Pending 6s
1.Could not create pvc.test on web console.
2.Could create pvc.test in cli successfully.
1,2.Should have consistent validation about pvc name from web console and cli.
Creating other resources have same issue, too. eg: route.
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.
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.
Commit pushed to master at https://github.com/openshift/origin-web-console
Bug 1414691 - Fix name validation for several resources
This has been merged into ocp and is in OCP v18.104.22.168 or newer.
Tested on OCP v22.214.171.124 :
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.
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.