add missing serverless and template update flags#266
add missing serverless and template update flags#266vavo wants to merge 2 commits intorunpod:mainfrom
Conversation
|
Promptless prepared a documentation update related to this change. Triggered by PR #266 Added documentation for the Review at https://app.gopromptless.ai/suggestions/01df3d1e-6473-4dd2-b512-9ad14493bf3a |
TimPietruskyRunPod
left a comment
There was a problem hiding this comment.
thanks for this — the serverless update --template-id and template update --container-disk-in-gb flags are genuinely useful additions. this is complementary to #271 (which adds flags to create commands, not update), so no overlap.
a few things to address:
partial update on failure
if the REST update succeeds but the GraphQL --template-id call fails, the endpoint is left partially updated with no rollback or warning. at minimum, print a warning to stderr saying the REST fields were updated but the template swap failed.
container-disk-in-gb zero-value problem
the ContainerDiskInGb field uses int with omitempty in the JSON tag. setting it to 0 would silently omit it from the request. if 0 is a valid value the user might want to send, this is a bug. consider using *int or removing omitempty.
double error reporting
runUpdate calls output.Error(err) and then returns fmt.Errorf(...). cobra will also handle the returned error, so the user sees the error twice. pick one path.
e2e testing
please verify against the live api — create an endpoint, update its template-id, confirm the change in the response, clean up.
this can merge alongside #271 with minor conflict resolution on endpoints.go whitespace. looking forward to it.
|
Hi Tim, thanks for the review, I'll fix the PR when I get a chance. regarding e2e tests - for some reason I've though this is something you run as part of the review. From now on I'll include them as part of the PRs. |
|
Hi Tim, went through the follow-up items and updated the branch. Let me know if I forgot something. changes made:
verification:
|
TimPietruskyRunPod
left a comment
There was a problem hiding this comment.
thanks for addressing all the feedback — the partial-update warning, the *int fix for container-disk-in-gb, and removing the duplicate error output all look good.
one last thing: if the user runs serverless update <id> without passing any flags, the command silently succeeds and just prints the current endpoint state. it would be better to return an error like "no update flags specified" so the user knows they forgot to specify what to update. same applies to template update.
once that's in, this is good to go.
E-252: add missing serverless and template update flags
runpodctl serverless update --template-idandrunpodctl template update --container-disk-in-gb.runpodctlas the primary binary; drop-in upgrade for existing users.main:runpodctl serverless create --network-volume-idalready existsrunpodctl template create --volume-mount-pathalready works; i live-verified/modelspersisted on create/getTest plan:
template update --container-disk-in-gbon a disposable template, then delete itserverless update --template-idon a disposable endpoint with two disposable serverless templates, then delete all resources