New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 1827297: Fix resource limits validation error #5172
Bug 1827297: Fix resource limits validation error #5172
Conversation
@debsmita1: This pull request references Bugzilla bug 1827297, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
convertToBaseValue(`${request}${requestUnit}`) <= | ||
convertToBaseValue(`${limit}${limitUnit}`) | ||
(requestUnit ? convertToBaseValue(`${request}${requestUnit}`) : request) <= | ||
(limitUnit ? convertToBaseValue(`${limit}${limitUnit}`) : limit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So convertToBaseValue
returns the number only, if unit is not present. That means it should work here as when cores is selected the selectedKey is an empty string and hence the respective unit value should be an '' ". Instead of adding an extra check here which is already present in convertToBaseValue
you should try to figure out why we are getting undefined instead of " " here. Units should never be undefined because we are setting a default unit and in case it changes we should have that unit value or " " in case of cores.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed these changes and added ensure()
in the yup validation of requestUnit
and limitUnit
so that <empty-string>
is not considered as undefined
1946b7e
to
af8615a
Compare
@debsmita1: This pull request references Bugzilla bug 1827297, which is valid. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/lgtm |
/assign @christianvogt |
verified locally, works as expected |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt, debsmita1, divyanshiGupta, nemesis09 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@debsmita1: All pull requests linked via external trackers have merged: openshift/console#5172. Bugzilla bug 1827297 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Fixes
https://issues.redhat.com/browse/ODC-3111
Analysis / Root cause
when unit
cores
is selected the value of the unit is read as undefined, which when concatenated with the numeric value and passed toconvertToBaseValue
,null
is returned.Solution Description
added
ensure()
in the yup validation ofrequestUnit
andlimitUnit
so that it accepts<empty-string>
and don't consider them as undefined.GIF
/kind bug