Skip to content

container rm: suppress forced not found errors#7110

Draft
HajimohammadiNet wants to merge 1 commit into
docker:masterfrom
HajimohammadiNet:fix-container-rm-force-output
Draft

container rm: suppress forced not found errors#7110
HajimohammadiNet wants to merge 1 commit into
docker:masterfrom
HajimohammadiNet:fix-container-rm-force-output

Conversation

@HajimohammadiNet

Copy link
Copy Markdown

- What I did

Fixes #7076.

Suppresses stderr output for docker rm --force when the daemon reports that a container was not found. The command already treats that case as non-fatal; this makes the output match the successful exit status and the existing docker network rm -f behavior.

- How I did it

Removed the stderr write in the --force + not-found branch, and added a regression assertion to TestRemoveForce.

- How to verify it

./scripts/with-go-mod.sh go test ./cli/command/container

- Human readable description for the release notes

docker rm --force no longer prints a not found error for containers that do not exist.

Signed-off-by: AmirHossein HajiMohammadi <a.hajimohammadi@rahkar.team>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review rm behavior

1 participant