containerd / containerd/nerdctl

Wrong image reference is selected as the removal target

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

Description

### Description

Nydus-snapshotter smoke test is calling `nerdctl` with enabling `nydus-snapshotter` to operate containers and images.
Recently, I am planning to upgrade the smoke test dependencies like `containerd` and `nerdctl`. But the smoke test failed, please check out the PR https://github.com/containerd/nydus-snapshotter/pull/327. This PR updates containerd to 1.6.15 and nerdctl to 1.1.0. I investigate the problem a bit and guess that something is wrong in nerdctl v1.1.0 after I changed nerdctl to v1.0.0 and v0.22.2 and no problem happened.

The error message is
```
time="2023-01-18T07:11:25Z" level=fatal msg="failed to get image ghcr.io/dragonflyoss/image-service/wordpress:nydus-nightly-v6 for container: image \"ghcr.io/dragonflyoss/image-service/wordpress:nydus-nightly-v6\": not found"
```

The test result https://github.com/containerd/nydus-snapshotter/actions/runs/3946522051/jobs/6754364236

The error message said it can't find image `ghcr.io/dragonflyoss/image-service/wordpress:nydus-nightly-v6` however, it is removing image `ghcr.io/dragonflyoss/image-service/tomcat:nydus-nightly-v5`

The test script is
```shell
function pull_remove_multiple_images {
local daemon_mode=$1
echo "testing $FUNCNAME"
nerdctl_prune_images
reboot_containerd "${daemon_mode}"

# Because nydusd is not started right after image pull.
# Nydusd is started when preparing the writable active snapshot as the
# uppermost layer. So we must create a container to start nydusd.
# Then to test if snapshotter's nydusd daemons management works well

nerdctl --snapshotter nydus image pull "${JAVA_IMAGE}"
nerdctl --snapshotter nydus image pull "${WORDPRESS_IMAGE}"
nerdctl --snapshotter nydus image pull "${TOMCAT_IMAGE}"

nerdctl --snapshotter nydus create --rm --net none "${TOMCAT_IMAGE}"
nerdctl --snapshotter nydus create --rm --net none "${WORDPRESS_IMAGE}"

echo "before rm java"
nerdctl --snapshotter nydus image rm --force "${JAVA_IMAGE}"
echo "before rm wordpress"
nerdctl --snapshotter nydus image rm --force "${WORDPRESS_IMAGE}"
echo "before rm tomcat"
# Deleteing with flag --async as a fuzzer
nerdctl --snapshotter nydus image rm --force --async "${TOMCAT_IMAGE}"
nerdctl --snapshotter nydus image pull "${TOMCAT_IMAGE}"
nerdctl --snapshotter nydus create --net none "${TOMCAT_IMAGE}"

detect_go_race
```

### Steps to reproduce the issue

1.
2.
3.

### Describe the results you received and expected

The tomcat image should be removed

### What version of nerdctl are you using?

v1.1.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.