-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
allow kb granularity for lua shared dicts #6750
Conversation
Hi @timmysilv. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/ok-to-test |
/assign @ElvinEfendi |
func dictStrToKb(sizeStr string) int { | ||
sizeMatch := dictSizeRegex.FindStringSubmatch(sizeStr) | ||
if sizeMatch == nil { | ||
return -1 |
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 use the convention of a negative return value implying an error here. If there is a preferred format, let me know. It just seemed most minimal and intuitive to me when making this.
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
/remove-lifecycle stale |
/assing @moonming If you can please take a look, will appreciate that |
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.
Left some minor/nit things.
I'm curious about why aren't we converting Kb to Mb as *1024 and instead using 1000, but maybe I'm missing something.
I'll leave the approval here, and ask someone else just to make a final review.
Thanks!
I will review this tomorrow (here is 11:50 pm 😄 |
/assign |
@timmysilv: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
Update internal/ingress/controller/template/configmap.go Co-authored-by: Ricardo Katz <[email protected]>
totally should have been 1024 and not 1000, thanks for pointing it out! |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rikatz, timmysilv 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 |
Update internal/ingress/controller/template/configmap.go Co-authored-by: Ricardo Katz <[email protected]> Co-authored-by: Ricardo Katz <[email protected]>
What this PR does / why we need it:
Lua shared dicts can be configured via Configmaps, but it enforces a megabyte granularity. This PR adds regex parsing to allow an appended "k" or "m" (case-insensitive) to specify the size unit of the shared dict. If no unit is specified, it will default to the old behaviour of using megabytes. If for example a user wanted to add many shared dicts of only 16k size, this PR would make sure they don't all use the previous minimum size of 1MB, which could become a considerable memory optimization.
Types of changes
Which issue/s this PR fixes
How Has This Been Tested?
Checklist:
PS: I changed
TemplateWriter
toWriter
because my go-lint plugin told me to.