fix: parse serverless networkVolumeIds returned as id strings#292
Open
TimPietruskyRunPod wants to merge 2 commits into
Open
fix: parse serverless networkVolumeIds returned as id strings#292TimPietruskyRunPod wants to merge 2 commits into
TimPietruskyRunPod wants to merge 2 commits into
Conversation
the rest read endpoint returns networkVolumeIds as bare id strings
([vol-1]), but the Endpoint struct only accepted the graphql write
shape ([{networkVolumeId}]), so every serverless get/list failed with
a json unmarshal error. add a custom UnmarshalJSON on
EndpointNetworkVolume that accepts either shape.
the existing get/list tests re-encoded an Endpoint struct as the mock response, so the fixture json always matched the struct (object-shape networkVolumeIds) and could never catch a read/write shape divergence. serve raw rest wire json instead (networkVolumeIds as bare id strings) and assert it parses, so a regression to a single-shape struct fails at the function level, not just in the unmarshal unit test.
justinwlin
approved these changes
Jun 26, 2026
|
Closes #288 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
problem
runpodctl serverless getandserverless listboth fail for every endpoint that has a network volume attached:the rest read endpoint returns
networkVolumeIdsas an array of bare id strings:but the
Endpointstruct only accepted the graphqlsaveEndpointwrite shape ([{"networkVolumeId":"..."}]). read and write shapes differ, so all serverless reads broke.fix
add a custom
UnmarshalJSONonEndpointNetworkVolumethat accepts either a bare id string (rest read) or an object (graphql write). no change to the write path.testing
TestEndpointNetworkVolumeIDsUnmarshal)serverless getandserverless listnow succeed on endpoints with attached network volumes (previously errored). read-only, no resources created.