You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello when I am trying to remove image with --force flag, even though not existing image, bash is showing that, command execution is successfully which means 0. Here are three different situation;
command
output
exit-code
comment
nerdctl image rm -f image_name --namespace k8s.io
ERRO[0000] 1 errors: no such image: image_name
0
There is no container named container_name and didnt remove, but exit code is 0 which means succesfully, I am expecting exit code 1
Thank you for taking the time to report the behavior you observed with the nerdctl rmi -f command when attempting to remove a non-existent image.
After conducting a thorough investigation and referencing Docker's behavior, I can confirm that this is not a bug, but the intended behavior. When Docker encounters a non-existent image, the docker rmi -f command is designed to return an exit code of 0 to silently fail the operation. This approach is chosen so as to not disrupt scripts or automated processes that might be using this command. The command still prints out an error message to inform the user of the attempt to remove a non-existent image.
Therefore, as nerdctl is a Docker-compatible command line, it is expected for nerdctl rmi -f to replicate this behavior. When attempting to remove a non-existent image, it should return an exit code of 0 while still printing an error message.
Description
Hello when I am trying to remove image with --force flag, even though not existing image, bash is showing that, command execution is successfully which means 0. Here are three different situation;
Steps to reproduce the issue
Describe the results you received and expected
I am expecting exit code 1 even though i forced to remove to not existing image.
What version of nerdctl are you using?
nerdctl version 1.4.0
Are you using a variant of nerdctl? (e.g., Rancher Desktop)
None
Host information
No response
The text was updated successfully, but these errors were encountered: