-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add support for 0.5 core / 512 Mi resource requests for spring-cloud deployments #3486
Conversation
spring cloud |
if not re.match(r"^\d+m?$", cpu): | ||
raise CLIError("CPU quantity should be millis (500m) or integer (1, 2, ...)") |
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.
Could you add some explanation for the function of the regular expression?
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.
The current released version only supports integer quantity ([1, 8]). The change being reviewed introduced the notation ###m
for millis, and the only supported fractional amount is 500m
. However, the user is also allowed to specify 1000m
for 1
.
The regex here is to validate the input from the client side, with some digits followed by optional m
. I added some comments in the updated code.
except ValueError: | ||
pass | ||
|
||
if not re.match(r"^\d+[MG]i$", unified): |
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.
Could you add some explanation for the function of the regular expression?
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.
We allow the user to specify the memory quantity with either ###Mi
or ###Gi
, for example, 1024Mi
, 3Gi
. The code above this line is to add backward compatibility for legacy input, which uses integer for Gi
values.
The regular expression here add some client side validation for the user input, to restrict it to be some digits followed by Mi
or Gi
. (Note that integer input will be converted to ###Gi
before this validation).
pass | ||
|
||
if not re.match(r"^\d+[MG]i$", unified): | ||
raise CLIError("Memory quantity should be integer followed by unit (Mi/Gi)") |
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.
Please use the specific error type InvalidArgumentValueError
instead of CLIError
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.
updated.
This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
azdev style <YOUR_EXT>
locally? (pip install azdev
required)(for the newly added code)
python scripts/ci/test_index.py -q
locally?For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your PR is merged into master branch, a new PR will be created to update
src/index.json
automatically.The precondition is to put your code inside this repo and upgrade the version in the PR but do not modify
src/index.json
.