-
Notifications
You must be signed in to change notification settings - Fork 365
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
api: support buffer limit in clientTrafficPolicy #2805
Merged
Merged
Changes from 19 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
cafad23
api: support buffer limit in clientTrafficPolicy
yaelSchechter b1deee3
Merge branch 'main' into buffer-limit-api
yaelSchechter 26d992d
run make commands
yaelSchechter 4f6c2da
Merge branch 'main' into buffer-limit-api
yaelSchechter b6b1763
Merge branch 'main' into buffer-limit-api
yaelSchechter e3e46c8
resolve conflicts
yaelSchechter 874d24f
Merge branch 'main' into buffer-limit-api
yaelSchechter dd6b526
run gen-check
yaelSchechter f303cc0
Merge branch 'buffer-limit-api' of https://github.com/yaelSchechter/e…
yaelSchechter 8339fa6
Merge branch 'main' of https://github.com/yaelSchechter/envoy-gateway…
yaelSchechter 847ee5d
fix cr comment
yaelSchechter 21a8c9c
Merge branch 'main' into buffer-limit-api
yaelSchechter b86fd68
add default
yaelSchechter f9755cb
Merge branch 'main' into buffer-limit-api
yaelSchechter 83e8cbf
resolve conflicts
yaelSchechter 6c90143
resolve conflicts
yaelSchechter 1b679b0
resolve conflicts
yaelSchechter 99ba4d4
add examples
yaelSchechter ebb0a4e
Merge branch 'main' into buffer-limit-api
yaelSchechter 9112b6a
Merge branch 'main' into buffer-limit-api
yaelSchechter 93ae109
Merge branch 'main' into buffer-limit-api
yaelSchechter 249fac4
use uint32 for buffer limit
yaelSchechter 59ce260
Merge branch 'main' of https://github.com/yaelSchechter/envoy-gateway…
yaelSchechter ea9696c
Merge branch 'buffer-limit-api' of https://github.com/yaelSchechter/e…
yaelSchechter 1eaf88f
use quantity and add a schema validation
yaelSchechter abf1f36
Merge branch 'main' into buffer-limit-api
yaelSchechter 3706559
add a type check
yaelSchechter 1326cb4
Merge branch 'buffer-limit-api' of https://github.com/yaelSchechter/e…
yaelSchechter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
looks like the type accepts a lot more such as
500m
is not relevant for this field.can we limit it to specific types relevant for memory
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.
Do you mean, limit the use for only binary suffixes (
Ki | Mi | Gi | Ti | Pi | Ei
) and not decimal suffixed? (m | "" | k | M | G | T | P | E
)If so, I can change the example and limit it using the kubebuilder schema validation.
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.
Maybe
*uint32
is a better option after all, validating the*resource.Quantity
might be a bit complex (unnecessarily) :)Changed to
*uint32
.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.
fwiw I did like the fact that the abstracted type was handling known quantities very well
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.
what do you think about runtime validation instead? users will get an error on the CTP but it won't prevent them from applying a resource with cpu specific suffixes
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.
sure, so the outlining the goal
Options
https://github.com/kubernetes-sigs/gateway-api/blob/9183329ef9cff3f9222f001d2e112f325108c761/apis/v1/shared_types.go#L702
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.
Changed back to
Quantity
and added a cel validation. It will check that the suffix, if present, is compatible with the suffixes for memory: units of memory in k8s.One more thing, values without suffix, like
1500
(bytes) must be specified with""
(otherwise there is an error). Is it something known to users as k8s behavior, or should I document it as well?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.
can you elaborate on
""
, that feels like something that might annoy the user :)thoughts on the string approach with kubebuilder validations, and then typecasting into
resource.Quantity
so the user doesnt hit the gotcha ?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.
Lior's suggestion solved the problem 👍