Bug 1378243

Summary: clusterresourcequota should not block emails in client-side validation
Product: OKD Reporter: Fabiano Franz <ffranz>
Component: ocAssignee: Fabiano Franz <ffranz>
Status: CLOSED CURRENTRELEASE QA Contact: Xingxing Xia <xxia>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.xCC: aos-bugs, mmccomas, wmeng, xiaocwan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-09 21:53:08 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 Fabiano Franz 2016-09-21 21:57:35 UTC
Description of problem:

oc create clusterresourcequota 
does not accept email address as a valid regex pattern.

error: couldn't parse the selector string "openshift.io/requester=test+user": unable to parse requirement: invalid label value: "test+user": must match the regex (([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])? (e.g. 'MyValue' or 'my_value' or '12345')

Comment 1 Fabiano Franz 2016-09-21 21:58:01 UTC
Fixed in https://github.com/openshift/origin/pull/10912

Comment 2 Xingxing Xia 2016-09-22 08:21:18 UTC
Yeah, the bug is indeed an issue because `oc annotate` with email can succeed:
$ oc annotate namespace xxia-proj --config ./admin.kubeconfig openshift.io/requester=deads
namespace "xxia-proj" annotated

Verified this bug with:
oc v1.4.0-alpha.0+6e155d0
kubernetes v1.4.0-beta.3+d19513f
features: Basic-Auth GSSAPI Kerberos SPNEGO

$ oc create clusterquota for-deads-email-by-annotation --config ./admin.kubeconfig --project-annotation-selector=openshift.io/requester=deads --hard=secrets=50
clusterresourcequota "for-deads-email-by-annotation" created

$ oc get clusterquota for-deads-email-by-annotation --config ./admin.kubeconfig -o yaml | grep openshift.io/requester
    openshift.io/requester: deads