Skip to content

shim v2 doesn't pass Moby test TestContainerStartOnDaemonRestart (because shim v2 uses hard-coded RuncRoot) #4326

@AkihiroSuda

Description

@AkihiroSuda

Description

shim v2 io.containerd.runc.v2 doesn't pass Moby test TestContainerStartOnDaemonRestart: https://github.com/moby/moby/blob/88241b99893cce78a7734a19b38d468d0dcb6156/integration/container/daemon_linux_test.go#L20-L68 (moby/moby#36145)

Steps to reproduce the issue:

  1. Checkout moby/moby@88241b9
  2. Apply the following patch to ensure that the daemon uses shim v2. This step is not needed on the cgroup v2 hosts, as cgroup v2 mode always uses shim v2.
diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go
index 1a577276ef..1fdb924f77 100644
--- a/daemon/daemon_unix.go
+++ b/daemon/daemon_unix.go
@@ -1757,7 +1757,7 @@ func (daemon *Daemon) setupSeccompProfile() error {
 }
 
 func (daemon *Daemon) useShimV2() bool {
-       return cgroups.IsCgroup2UnifiedMode()
+       return true
 }
 
 // RawSysInfo returns *sysinfo.SysInfo .
  1. DOCKER_BUILD_ARGS="--build-arg CONTAINERD_COMMIT=705b8527d4945db601954246972674a25ed49347" TESTFLAGS="-test.run TestContainerStartOnDaemonRestart" TEST_SKIP_INTEGRATION_CLI=1 make test-integration

Describe the results you received:

--- FAIL: TestContainerStartOnDaemonRestart (2.37s)
    daemon_linux_test.go:67: assertion failed: error is not nil: Error response from daemon: OCI runtime create failed: container with id exists: 2585935e9bb8c9e5678466e4c7d001082abeacc6945d5c00cdc8f1cb713ebdd0: unknown: failed to start test container
FAIL

Describe the results you expected:

The test should succeed

Output of containerd --version:
705b852 (master as of June 16).

The issue happens with v1.3.4 as well.

Any other relevant information:
Moby PR moby/moby#41115 is blocked due to this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions