filters: do not index an empty container command #29820
All Vouch review confidence checks passed
Residual risk 0.03 = Change Risk (0.27) × (1 − Review Confidence (0.89)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.27 · 39 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.89 · 2 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.221
Real PR Conversation Timeline
4 items
[NON-BLOCKING] Packit jobs failed. @podman-container-tools/packit-jobs please check. Everyone else, feel free to ignore.
Please use PodmanExitCleanly()
Changes Requested
Just testing nit.
Honny1
nishantbkl3345-ship-it
podman ps --filter command=<value> panics with "index out of range [0] with length 0" when any container in the store has no command recorded. GenerateContainerFilterFuncs indexes Container.Command()[0] without first checking the length.
A container has no command whenever it was created without an explicit command and the image contributed no CMD. Passing --entrypoint on its own is the shortest way to get there:
podman create --name t --entrypoint /bin/true alpine
podman ps -a --filter command=true
specgenutil.FillOutSpecGen only sets SpecGenerator.Command when a command was given on the command line, CreateContainer only calls WithCommand when that field is non-nil, and the image CMD fallback in container_internal.go is skipped once an entrypoint is set, so config.Command stays empty. An image that declares an ENTRYPOINT and no CMD reaches the same state without passing any flag, and nothing rejects such a container at creation time.
The filter is used by podman ps, by the libpod and Docker-compat /containers/json endpoints and by podman auto-update --filter, so one container of this shape breaks container listing for the whole store. On the CLI the command aborts with a stack trace; over the API the panic handler turns it into a 500.
Skip containers that have no command, which is what the other readers of this field already do in completion.go, container_inspect.go and container_exec.go. The external container variant of the filter indexes the same way. It cannot be reached today because ListStorageContainer always fills a command in, but guard it identically so the crash cannot reappear if that ever changes.
<!-- Thanks for sending a pull request! -->
Checklist
Ensure you have completed the following checklist for your pull request to be reviewed:
<!-- Use [x] to mark as done, or click the checkbox after opening PR -->
commits. (
git commit -s). (If needed, usegit commit -s --amend). The author email must matchthe sign-off email address. See CONTRIBUTING.md
for more information.
Fixes: #00000in commit message (if applicable)make validatepr(format/lint checks)Noneif no user-facing changes)Does this PR introduce a user-facing change?
<!--
Write
Noneif there are no user-facing changes, otherwise enter your release note below.Include "action required" if users need to take action when upgrading.
-->
``
release-note``