Bug 1321292 - Should give proper messages when create a quota with decimal numbers
Summary: Should give proper messages when create a quota with decimal numbers
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: unspecified
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Derek Carr
QA Contact: Qixuan Wang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-25 09:20 UTC by Qixuan Wang
Modified: 2019-07-03 15:11 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-03 15:11:21 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Qixuan Wang 2016-03-25 09:20:21 UTC
Description of problem:
Create a quota with decimal numbers, message shows like:
Invalid value: "100m": must be an integer
It's correct for CPU, but not for other resources.


Version-Release number of selected component (if applicable):
openshift v1.1.4-274-g1b00abe
kubernetes v1.2.0-36-g4a3f9c5
etcd 2.2.5

How reproducible:
Always

Steps to Reproduce:
1. Create a project
# oc new-project qwang1

2. Apply quota with decimal numbers to a project 
# cat quota-d.yaml
apiVersion: v1
kind: ResourceQuota
metadata:
  name: quota-d
spec:
  hard:
    cpu: "0.20"
    memory: "1.5Gi"
    persistentvolumeclaims: "0.10"
    pods: "0.10"
    replicationcontrollers: "0.20"
    resourcequotas: "0.1"
    secrets: "0.10"
    services: "0.5"

# oc create -f quota-d.yaml -n qwang1 --config=/home/openshift.local.config/master/admin.kubeconfig 


Actual results:
2. [root@ip-172-18-3-170 home]# oc create -f quota-d.yaml -n qwang1 --config=/home/openshift.local.config/master/admin.kubeconfig 
The ResourceQuota "quota-d" is invalid.

* spec.hard[resourcequotas]: Invalid value: "100m": must be an integer
* spec.hard[secrets]: Invalid value: "100m": must be an integer
* spec.hard[services]: Invalid value: "500m": must be an integer
* spec.hard[persistentvolumeclaims]: Invalid value: "100m": must be an integer
* spec.hard[pods]: Invalid value: "100m": must be an integer
* spec.hard[replicationcontrollers]: Invalid value: "200m": must be an integer


Expected results:
It's better to give messages like this:
* pods: invalid value '0.10', Details: must be an integer


Additional info:

Comment 1 Derek Carr 2016-03-29 14:53:54 UTC
I will look to see if we can preserve the format from input.

Comment 2 Greg Blomquist 2019-07-03 15:11:21 UTC
No movement on this in 3 years.  If issues still persist in 4.x, please open a new bug.


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