Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1685017 - project with upper case alphabetic characters can be created
Summary: project with upper case alphabetic characters can be created
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.1
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 4.1.0
Assignee: Samuel Padgett
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-04 07:18 UTC by Yadan Pei
Modified: 2019-03-12 14:26 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-03-04 13:17:05 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Yadan Pei 2019-03-04 07:18:24 UTC
Description of problem:
when we set project name with upper case alphabetic characters, it can be created while it should not be.

Version-Release number of selected component (if applicable):
clusterversion: 4.0.0-0.nightly-2019-03-04-033148
console commit: d10fb8b637562015a0c704e72855e2d0c318783c

How reproducible:
Always

Steps to Reproduce:
1. user logs into cluster console
2. create project at Home -> Projects
3. set project name with upper case, for example: TEST, hit 'Create" button

Actual results:
3. a project with name 'test' will be created

Expected results:
3. A valid DNS-1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character, so we should give error message indicating upper case is not allowed, thus project should not be created.

Additional info:
$ oc new-project TESTTEST
The ProjectRequest "TESTTEST" is invalid: metadata.name: Invalid value: "TESTTEST": a DNS-1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')

Comment 1 Samuel Padgett 2019-03-04 13:17:05 UTC
Console deliberately lowercases the names of resources it creates to avoid errors:

https://github.com/openshift/console/blob/8748f75563a71e1e344479fb463994c4a09f5f61/frontend/public/module/k8s/resource.js#L67-L71

I can see arguments for and against this, but the behavior is intentional and working as designed.

Comment 3 Yadan Pei 2019-03-05 01:01:03 UTC
I'm still a little against for it, since DNS-1123 validation will only allow lowercase and auto transition to lowercase maybe a good user experience, maybe not.


Anyway thanks for letting me know, Sam.


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