feat(pod): add list filters and default to running pods#232
Conversation
add --status, --since, --created-after, and --all flags to pod list. default behavior now shows only running pods (like docker ps). use --all or --status to see exited pods.
PR Review:
|
| Severity | Issue |
|---|---|
| High | IncludeMachine/IncludeNetworkVolume silently dropped from API call |
| Medium | --since + --created-after interaction undocumented / surprising |
| Medium | parseDuration rejects standard suffixes (m, s, etc.) |
| Medium | --all silently ignored when --status is also provided |
| Medium | Missing unit tests for new pure functions and filtering logic |
| Low | podListOutput.CreatedAt typed as interface{} — normalise it |
| Low | parseDuration accepts zero/negative values |
| Low | output.Error call consistency |
|
Addressed all review feedback:
@max4c ready for another look |
Re-review: Follow-up on Previous FeedbackThanks for the quick turnaround. Here is a precise accounting of what was addressed, what remains, and two new issues I noticed in the updated diff. Previously Raised Issues — Status1. Dead API fields (
|
| # | Issue | Status |
|---|---|---|
| 1 | Dead IncludeMachine/IncludeNetworkVolume API fields |
Fixed |
| 2 | --since + --created-after undocumented interaction |
Partially addressed — no error returned, no docs |
| 3 | parseDuration rejecting 30m, 1h30m |
Fixed |
| 4 | --all + --status conflict |
Fixed |
| 5 | Missing unit tests | Fixed |
| 6 | CreatedAt typed as interface{} in output struct |
Fixed |
| 7 | parseDuration zero/negative values |
Fixed |
| 8 | output.Error double-print risk |
Not addressed |
| A | parseCreatedAt takes interface{} unnecessarily |
New — low severity |
| B | --since flag description outdated |
New — low severity |
Most of the meaningful issues have been addressed. The two remaining actionable items are: (2) either error or document when --since and --created-after are used together, and (8) verify there is no double error printing. Items A and B are minor polish.
|
Two remaining nits:
|
…-print - Add mutual exclusion error for --since and --created-after (consistent with existing --all/--status handling) - Set SilenceErrors on root command so Cobra does not re-print errors that commands already emit as JSON via output.Error Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
max4c
left a comment
There was a problem hiding this comment.
addressed comments and review lgtm
|
📝 Documentation updates detected! Updated existing suggestion: Update runpodctl documentation for v2.0 Tip: Tell your friends working on non-commercial open-source projects to apply for free Promptless access at promptless.ai/oss ❤️ |
Summary
--status,--since,--created-after, and--allflags topod listdocker ps)--allor--status exitedto see non-running podsUsage
Test plan
go test ./cmd/pod/...)pod listreturns only running podspod list --allincludes exited pods