Skip to content

fix: change int params in the EndpointupdateRequest struct - #313

Open
dhollinger wants to merge 2 commits into
runpod:mainfrom
dhollinger:fix_endpoint_req_types
Open

fix: change int params in the EndpointupdateRequest struct#313
dhollinger wants to merge 2 commits into
runpod:mainfrom
dhollinger:fix_endpoint_req_types

Conversation

@dhollinger

@dhollinger dhollinger commented Jul 28, 2026

Copy link
Copy Markdown

Summary

Updated the following parameters in the api.EndpointUpdateRequest struct from type int to an integer pointer (*int).

  • WorkersMin
  • WorkersMax
  • IdleTimeout
  • ScalerValue

This is to fix a bug in the enpoints where a value of 0 causes the generated JSON to omit these fields as "empty" as per the omitempty JSON tag. Changing them to integer pointer (*int) will allow a nil value to trigger the omitempty JSON tag, while a value of 0 will be treated as a valid value.

fixes #298

Test plan:

  • go test ./...
  • go test -tags e2e ./e2e

updated the following parameters in the api.EndpointUpdateRequest struct
from type `int` to an integer pointer.

* WorkersMin
* WorkersMax
* IdleTimeout
* ScalerValue

This is to fix a bug in the enpoints where a value of `0` causes the
generated JSON to omit these fields as "empty" as per the `omitempty`
JSON tag. Changing them to integer points will allow a `nil` value to
trigger the `omitempty` JSON tag, while a value of `0` will be treated
as a valid value.
@dhollinger dhollinger changed the title change int params in the EndpointupdateRequest struct fix: change int params in the EndpointupdateRequest struct Jul 28, 2026
Moved `wrkMax` to the top of the `TestUpdateEndpoint` function.
Added a `wrkMin` with a value of `0` to the function.

Added `WorkersMin` with the value of `wrkMin` to the encoded JSON in the
test.

Passed the `WorkersMin` paramter with a reference to the `wrkMin`
address (`&wrkMin`) into the `client.UpdateEndpoint` call in the test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

runpodctl serverless update --workers-min 0 does not send workersMin in PATCH request

1 participant