Skip to content
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

max-body-size and read-buffer-size do not accept units #1489

Open
mikeee opened this issue Feb 20, 2025 · 0 comments
Open

max-body-size and read-buffer-size do not accept units #1489

mikeee opened this issue Feb 20, 2025 · 0 comments
Assignees
Labels
kind/bug Something isn't working P0
Milestone

Comments

@mikeee
Copy link
Member

mikeee commented Feb 20, 2025

Expected Behavior

I should be able to define the arguments max-body-size and read-buffer-size with units, e.g. "4Mi" as per docs.
https://v1-15.docs.dapr.io/reference/arguments-annotations-overview/

Actual Behavior

At the moment, the flag is being parsed as an int rather than a string before invoking the runtime.

Steps to Reproduce the Problem

dapr run --app-id custom-grpc-client \
		 -d ./config \
		 --max-body-size 4Mi \
		 --log-level debug \
		 go run ./custom-grpc-client/main.go

Release Note

RELEASE NOTE: FIX Allow max-body-size and read-buffer-size to be defined with units

@mikeee mikeee added kind/bug Something isn't working P0 labels Feb 20, 2025
@mikeee mikeee added this to the v1.15 milestone Feb 20, 2025
@mikeee mikeee self-assigned this Feb 20, 2025
mikeee added a commit to mikeee/dapr_cli that referenced this issue Feb 20, 2025
`max-body-size` and `read-buffer-size` now accept units as defined in the docs.

Fixes dapr#1489

Signed-off-by: Mike Nguyen <hey@mike.ee>
yaron2 pushed a commit that referenced this issue Feb 21, 2025
* fix: arguments accept units
`max-body-size` and `read-buffer-size` now accept units as defined in the docs.

Fixes #1489

Signed-off-by: Mike Nguyen <hey@mike.ee>

* chore: gofumpt

Signed-off-by: Mike Nguyen <hey@mike.ee>

* refactor: modify logic to comply with vetting

Signed-off-by: Mike Nguyen <hey@mike.ee>

* chore: gofumpt -w .

Signed-off-by: Mike Nguyen <hey@mike.ee>

* refactor: set defaults
`max-body-size` is defaulted to 4Mi
`request-buffer-size` is defaulted to 4Ki

This is inline with the runtime.

Signed-off-by: Mike Nguyen <hey@mike.ee>

* fix: set defaults in run and annotate

Signed-off-by: Mike Nguyen <hey@mike.ee>

* chore: gofumpt

Signed-off-by: Mike Nguyen <hey@mike.ee>

* refactor: exit with error rather than panic

Co-authored-by: Anton Troshin <troll.sic@gmail.com>
Signed-off-by: Mike Nguyen <hey@mike.ee>

---------

Signed-off-by: Mike Nguyen <hey@mike.ee>
Co-authored-by: Anton Troshin <troll.sic@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working P0
Projects
None yet
Development

No branches or pull requests

1 participant