fix(pod): restore --stop-after and --terminate-after, validated - #331
Draft
justinwlin wants to merge 2 commits into
Draft
fix(pod): restore --stop-after and --terminate-after, validated#331justinwlin wants to merge 2 commits into
justinwlin wants to merge 2 commits into
Conversation
Both flags were forwarded to podFindAndDeployOnDemand, which accepts stopAfter/terminateAfter and never acts on them: the pod keeps running, and billing, past the deadline. The value is also not readable back from the Pod type or REST v2, so the cli cannot detect the failure after the fact either. Nothing a client can do makes the timer fire, and a flag that silently costs money is worse than no flag, so both are gone. Passing one is now a usage error. Also drops StopAfter/TerminateAfter from CreatePodGQLInput and duration.ParseDeadline, which had no other caller.
justinwlin
force-pushed
the
justinlin/con-1258-enforce-runpodctl-stop-after-and-terminate-after-timers
branch
from
August 26, 2026 19:28
9c44819 to
d381563
Compare
Brings back the two flags with every client-side way of losing the deadline closed. Merge only once the api enforces stopAfter and terminateAfter; until then their removal is the correct behaviour. - duration.ParseDeadline accepts a duration (2h, 7d) or an rfc3339 time and rejects the past, so the documented duration form works instead of hitting the graphql DateTime scalar. - Both flags resolve before the create call, so a bad value never costs a billed pod. - CPU pods error rather than dropping the flag: they are created over rest v2, which has no scheduling field. - The resolved deadline is echoed to stderr, since neither the create response nor a pod read exposes it.
justinwlin
force-pushed
the
justinlin/con-1258-client-validate-schedule-flags
branch
from
August 26, 2026 19:29
6231272 to
9188ca5
Compare
Base automatically changed from
justinlin/con-1258-enforce-runpodctl-stop-after-and-terminate-after-timers
to
main
August 27, 2026 22:51
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.
Brings back
--stop-afterand--terminate-after, removed in #330, with every client-side way of losing the deadline closed.Do not merge until the API enforces the timer. Until then #330's removal is the correct behaviour, and this PR would put the silent-billing failure straight back. Stacked on #330.
What this fixes
1h,24h,7d; the GraphQLDateTimescalar rejects themduration.ParseDeadlineresolves durations against the clock and sends RFC 3339What it does not fix
Whether the pod actually stops.
stopAfter/terminateAfterare write-only from a client: valid input onPodFindAndDeployOnDemandInput, not readable on thePodtype, absent from REST v2. The CLI cannot verify the deadline landed, so the stderr note describes what was sent, not what will happen. Enforcement is an API-side change.Verification
Live against production:
Unit tests:
TestResolvePodSchedule,TestResolvePodScheduleNotesTheDeadline,TestParseDeadline.go test ./...green.