containerd / containerd/nerdctl

Image Removing Exit Code

Open
#2,400 2 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Go
Stars
10.4k
Forks
826
Avg merge
1d 23h
Merged PRs (30d)
44

Description

### 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;

|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|
|nerdctl image rm image_name --namespace k8s.io | ERRO[0000] 1 errors: no such image: image_name| 1| Normal behavior there is no problem|
|nerdctl image rm -f existing_image --namespace k8s.io| -| 0| Normal behavior there is no problem|

![image](https://github.com/containerd/nerdctl/assets/61538610/92d544e4-090d-4471-886a-af179aeb7a10)

### Steps to reproduce the issue

1. nerdctl image rm -f image_name --namespace k8s.io

### 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_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.