Skip to content

Commit 588cafd

Browse files
authored
Merge pull request #440 from kzys/runc-upgrade
Upgrade runc from 1.0-rc10 to 1.0-rc92
2 parents 5a89577 + 7611421 commit 588cafd

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

_submodules/runc

Submodule runc updated 901 files

runtime/service_integ_test.go

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
"github.com/containerd/containerd"
3333
"github.com/containerd/containerd/api/events"
3434
"github.com/containerd/containerd/cio"
35+
"github.com/containerd/containerd/containers"
3536
"github.com/containerd/containerd/namespaces"
3637
"github.com/containerd/containerd/oci"
3738
"github.com/containerd/containerd/pkg/ttrpcutil"
@@ -657,6 +658,24 @@ func TestLongUnixSocketPath_Isolated(t *testing.T) {
657658
}
658659
}
659660

661+
func allowDeviceAccess(_ context.Context, _ oci.Client, _ *containers.Container, s *oci.Spec) error {
662+
// By default, all devices accesses are forbidden.
663+
s.Linux.Resources.Devices = append(
664+
s.Linux.Resources.Devices,
665+
specs.LinuxDeviceCgroup{Allow: true, Access: "r"},
666+
)
667+
668+
// Exposes the host kernel's /dev as /dev.
669+
// By default, runc creates own /dev with a minimal set of pseudo devices such as /dev/null.
670+
s.Mounts = append(s.Mounts, specs.Mount{
671+
Type: "bind",
672+
Options: []string{"bind"},
673+
Destination: "/dev",
674+
Source: "/dev",
675+
})
676+
return nil
677+
}
678+
660679
func TestStubBlockDevices_Isolated(t *testing.T) {
661680
prepareIntegTest(t)
662681

@@ -706,15 +725,6 @@ func TestStubBlockDevices_Isolated(t *testing.T) {
706725
oci.WithProcessArgs("/bin/sh", "/var/firecracker-containerd-test/scripts/lsblk.sh"),
707726

708727
oci.WithMounts([]specs.Mount{
709-
// Exposes the host kernel's /dev as /dev.
710-
// By default, runc creates own /dev with a minimal set of pseudo devices such as /dev/null.
711-
{
712-
Type: "bind",
713-
Options: []string{"bind"},
714-
Destination: "/dev",
715-
Source: "/dev",
716-
},
717-
718728
// Exposes test scripts from the host kernel
719729
{
720730
Type: "bind",
@@ -723,8 +733,7 @@ func TestStubBlockDevices_Isolated(t *testing.T) {
723733
Source: "/var/firecracker-containerd-test/scripts",
724734
},
725735
}),
726-
// Make the host kernel's /dev readable
727-
oci.WithParentCgroupDevices,
736+
allowDeviceAccess,
728737
),
729738
)
730739
require.NoError(t, err, "failed to create container %s", containerName)

tools/docker/scripts/lsblk.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# tiny lsblk(8) equivalent to make integration tests distro-agnostic
3-
set -eu
3+
set -euo pipefail
44

55
echo 'NAME MAJ:MIN RM SIZE RO | MAGIC'
66

0 commit comments

Comments
 (0)