Bug 1293836
Summary: | Wrong RegEx when create quota with minus | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Qixuan Wang <qixuan.wang> |
Component: | oc | Assignee: | Derek Carr <decarr> |
Status: | CLOSED EOL | QA Contact: | Qingyu Wang <nobody+qwang> |
Severity: | low | Docs Contact: | |
Priority: | medium | ||
Version: | unspecified | CC: | aos-bugs, jokerman, maszulik, mmccomas |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-02-26 19:11:09 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: |
Description
Qixuan Wang
2015-12-23 09:10:37 UTC
The server is correctly validating that the incoming value conforms to the Kube syntax for compute resources. Since the regex is used to validate the incoming object before it's actually parsed, I am not sure I see a huge value in updating the code to special case the check for negative values versus just stating the value does not match the regex. Moving to low priority. Tested on OSE3.3(openshift v3.3.0.13, kubernetes v1.3.0+57fb9ac, etcd2.3.0+git), the problem has gone. [root@dhcp-141-95 testv3]# oc create -f negquota.yaml -n qwang1 --config=/home/qwang/admin.kubeconfig The ResourceQuota "negquota" is invalid. * spec.hard[pods]: Invalid value: "-10": must be greater than or equal to 0 * spec.hard[replicationcontrollers]: Invalid value: "-20": must be greater than or equal to 0 * spec.hard[resourcequotas]: Invalid value: "-2": must be greater than or equal to 0 * spec.hard[secrets]: Invalid value: "-10": must be greater than or equal to 0 * spec.hard[services]: Invalid value: "-5": must be greater than or equal to 0 * spec.hard[cpu]: Invalid value: "-20": must be greater than or equal to 0 * spec.hard[memory]: Invalid value: "-1Gi": must be greater than or equal to 0 * spec.hard[persistentvolumeclaims]: Invalid value: "-10": must be greater than or equal to 0 Fractional numbers, decimals, negative numbers can match the RegEx '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$' [root@dhcp-141-95 testv3]# cat quota-2.yaml apiVersion: v1 kind: ResourceQuota metadata: name: quota-2 spec: hard: cpu: "2/10" memory: "1/5Gi" persistentvolumeclaims: "1/10" pods: "1/10" replicationcontrollers: "2/10" resourcequotas: "3/10" secrets: "5/10" services: "5/10" [root@dhcp-141-95 testv3]# oc create -f quota-3.yaml -n qwang1 --config=/home/qwang/admin.kubeconfig unable to decode "quota-3.yaml": quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$' |