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
61ef2ce9
Commit
61ef2ce9
authored
Dec 09, 2020
by
Chris Kim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use version.Program
Signed-off-by:
Chris Kim
<
oats87g@gmail.com
>
parent
48925fcb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
agent.go
pkg/daemons/agent/agent.go
+4
-5
No files found.
pkg/daemons/agent/agent.go
View file @
61ef2ce9
...
@@ -11,6 +11,7 @@ import (
...
@@ -11,6 +11,7 @@ import (
"github.com/opencontainers/runc/libcontainer/system"
"github.com/opencontainers/runc/libcontainer/system"
"github.com/rancher/k3s/pkg/daemons/config"
"github.com/rancher/k3s/pkg/daemons/config"
"github.com/rancher/k3s/pkg/daemons/executor"
"github.com/rancher/k3s/pkg/daemons/executor"
"github.com/rancher/k3s/pkg/version"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/util/net"
"k8s.io/apimachinery/pkg/util/net"
"k8s.io/component-base/logs"
"k8s.io/component-base/logs"
...
@@ -20,8 +21,6 @@ import (
...
@@ -20,8 +21,6 @@ import (
_
"k8s.io/component-base/metrics/prometheus/version"
// for version metric registration
_
"k8s.io/component-base/metrics/prometheus/version"
// for version metric registration
)
)
const
k3sCgroupRoot
=
"/k3s"
func
Agent
(
config
*
config
.
Agent
)
error
{
func
Agent
(
config
*
config
.
Agent
)
error
{
rand
.
Seed
(
time
.
Now
()
.
UTC
()
.
UnixNano
())
rand
.
Seed
(
time
.
Now
()
.
UTC
()
.
UnixNano
())
...
@@ -210,7 +209,7 @@ func checkCgroups() (kubeletRoot, runtimeRoot string, hasCFS, hasPIDs bool) {
...
@@ -210,7 +209,7 @@ func checkCgroups() (kubeletRoot, runtimeRoot string, hasCFS, hasPIDs bool) {
last
:=
parts
[
len
(
parts
)
-
1
]
last
:=
parts
[
len
(
parts
)
-
1
]
i
:=
strings
.
LastIndex
(
last
,
".scope"
)
i
:=
strings
.
LastIndex
(
last
,
".scope"
)
if
i
>
0
{
if
i
>
0
{
kubeletRoot
=
k3sCgroupRoot
kubeletRoot
=
"/"
+
version
.
Program
}
}
}
}
}
}
...
@@ -238,8 +237,8 @@ func checkCgroups() (kubeletRoot, runtimeRoot string, hasCFS, hasPIDs bool) {
...
@@ -238,8 +237,8 @@ func checkCgroups() (kubeletRoot, runtimeRoot string, hasCFS, hasPIDs bool) {
if
system
==
"name=systemd"
{
if
system
==
"name=systemd"
{
last
:=
parts
[
len
(
parts
)
-
1
]
last
:=
parts
[
len
(
parts
)
-
1
]
if
last
!=
"/"
&&
last
!=
"/init.scope"
{
if
last
!=
"/"
&&
last
!=
"/init.scope"
{
kubeletRoot
=
k3sCgroupRoot
kubeletRoot
=
"/"
+
version
.
Program
runtimeRoot
=
k3sCgroupRoot
runtimeRoot
=
"/"
+
version
.
Program
}
}
}
}
}
}
...
...
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