Skip to content

Commit

Permalink
kubelet/cm: don't set Devices
Browse files Browse the repository at this point in the history
Since runc 1.0.0 it is now sufficient to have SkipDevices: true.

Signed-off-by: Kir Kolyshkin <[email protected]>
  • Loading branch information
kolyshkin committed Jul 16, 2021
1 parent eb5df86 commit e5b434e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
10 changes: 0 additions & 10 deletions pkg/kubelet/cm/cgroup_manager_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (
"github.com/opencontainers/runc/libcontainer/cgroups/fscommon"
cgroupsystemd "github.com/opencontainers/runc/libcontainer/cgroups/systemd"
libcontainerconfigs "github.com/opencontainers/runc/libcontainer/configs"
libcontainerdevices "github.com/opencontainers/runc/libcontainer/devices"
"k8s.io/klog/v2"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"

Expand Down Expand Up @@ -380,15 +379,6 @@ func getSupportedUnifiedControllers() sets.String {

func (m *cgroupManagerImpl) toResources(resourceConfig *ResourceConfig) *libcontainerconfigs.Resources {
resources := &libcontainerconfigs.Resources{
Devices: []*libcontainerdevices.Rule{
{
Type: 'a',
Permissions: "rwm",
Allow: true,
Minor: libcontainerdevices.Wildcard,
Major: libcontainerdevices.Wildcard,
},
},
SkipDevices: true,
}
if resourceConfig == nil {
Expand Down
10 changes: 0 additions & 10 deletions pkg/kubelet/cm/container_manager_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import (
utilio "k8s.io/utils/io"
utilpath "k8s.io/utils/path"

libcontainerdevices "github.com/opencontainers/runc/libcontainer/devices"
libcontaineruserns "github.com/opencontainers/runc/libcontainer/userns"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
Expand Down Expand Up @@ -396,15 +395,6 @@ func createManager(containerName string) (cgroups.Manager, error) {
Parent: "/",
Name: containerName,
Resources: &configs.Resources{
Devices: []*libcontainerdevices.Rule{
{
Type: 'a',
Permissions: "rwm",
Allow: true,
Minor: libcontainerdevices.Wildcard,
Major: libcontainerdevices.Wildcard,
},
},
SkipDevices: true,
},
}
Expand Down
10 changes: 0 additions & 10 deletions pkg/kubelet/dockershim/cm/container_manager_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"github.com/opencontainers/runc/libcontainer/cgroups"
cgroupfs "github.com/opencontainers/runc/libcontainer/cgroups/fs"
"github.com/opencontainers/runc/libcontainer/configs"
libcontainerdevices "github.com/opencontainers/runc/libcontainer/devices"
utilversion "k8s.io/apimachinery/pkg/util/version"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/klog/v2"
Expand Down Expand Up @@ -127,15 +126,6 @@ func createCgroupManager(name string) (cgroups.Manager, error) {
Memory: int64(memoryLimit),
MemorySwap: -1,
SkipDevices: true,
Devices: []*libcontainerdevices.Rule{
{
Minor: libcontainerdevices.Wildcard,
Major: libcontainerdevices.Wildcard,
Type: 'a',
Permissions: "rwm",
Allow: true,
},
},
},
}
return cgroupfs.NewManager(cg, nil, false), nil
Expand Down

0 comments on commit e5b434e

Please sign in to comment.