Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
3b5d7b06
Commit
3b5d7b06
authored
Jan 01, 2019
by
Darren Shepherd
Committed by
Erik Wilson
Jul 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update FindCgroupMountpointAndRoot to be compatible with newer runc
parent
6f46c276
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
cgroups_linux.go
pkg/kubelet/cm/util/cgroups_linux.go
+1
-1
utils.go
...hub.com/opencontainers/runc/libcontainer/cgroups/utils.go
+3
-3
No files found.
pkg/kubelet/cm/util/cgroups_linux.go
View file @
3b5d7b06
...
@@ -38,7 +38,7 @@ func GetPids(cgroupPath string) ([]int, error) {
...
@@ -38,7 +38,7 @@ func GetPids(cgroupPath string) ([]int, error) {
func
getCgroupPath
(
cgroupPath
string
)
(
string
,
error
)
{
func
getCgroupPath
(
cgroupPath
string
)
(
string
,
error
)
{
cgroupPath
=
libcontainerutils
.
CleanPath
(
cgroupPath
)
cgroupPath
=
libcontainerutils
.
CleanPath
(
cgroupPath
)
mnt
,
root
,
err
:=
libcontainercgroups
.
FindCgroupMountpointAndRoot
(
"devices"
)
mnt
,
root
,
err
:=
libcontainercgroups
.
FindCgroupMountpointAndRoot
(
cgroupPath
,
"devices"
)
// If we didn't mount the subsystem, there is no point we make the path.
// If we didn't mount the subsystem, there is no point we make the path.
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
...
...
vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go
View file @
3b5d7b06
...
@@ -23,11 +23,11 @@ const (
...
@@ -23,11 +23,11 @@ const (
// https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt
// https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt
func
FindCgroupMountpoint
(
subsystem
string
)
(
string
,
error
)
{
func
FindCgroupMountpoint
(
subsystem
string
)
(
string
,
error
)
{
mnt
,
_
,
err
:=
FindCgroupMountpointAndRoot
(
subsystem
)
mnt
,
_
,
err
:=
FindCgroupMountpointAndRoot
(
""
,
subsystem
)
return
mnt
,
err
return
mnt
,
err
}
}
func
FindCgroupMountpointAndRoot
(
subsystem
string
)
(
string
,
string
,
error
)
{
func
FindCgroupMountpointAndRoot
(
_
,
subsystem
string
)
(
string
,
string
,
error
)
{
// We are not using mount.GetMounts() because it's super-inefficient,
// We are not using mount.GetMounts() because it's super-inefficient,
// parsing it directly sped up x10 times because of not using Sscanf.
// parsing it directly sped up x10 times because of not using Sscanf.
// It was one of two major performance drawbacks in container start.
// It was one of two major performance drawbacks in container start.
...
@@ -257,7 +257,7 @@ func GetInitCgroupPath(subsystem string) (string, error) {
...
@@ -257,7 +257,7 @@ func GetInitCgroupPath(subsystem string) (string, error) {
}
}
func
getCgroupPathHelper
(
subsystem
,
cgroup
string
)
(
string
,
error
)
{
func
getCgroupPathHelper
(
subsystem
,
cgroup
string
)
(
string
,
error
)
{
mnt
,
root
,
err
:=
FindCgroupMountpointAndRoot
(
subsystem
)
mnt
,
root
,
err
:=
FindCgroupMountpointAndRoot
(
""
,
subsystem
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment