Commit 61ef2ce9 authored by Chris Kim's avatar Chris Kim
Browse files

use version.Program


Signed-off-by: default avatarChris Kim <oats87g@gmail.com>
parent 48925fcb
......@@ -11,6 +11,7 @@ import (
"github.com/opencontainers/runc/libcontainer/system"
"github.com/rancher/k3s/pkg/daemons/config"
"github.com/rancher/k3s/pkg/daemons/executor"
"github.com/rancher/k3s/pkg/version"
"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/util/net"
"k8s.io/component-base/logs"
......@@ -20,8 +21,6 @@ import (
_ "k8s.io/component-base/metrics/prometheus/version" // for version metric registration
)
const k3sCgroupRoot = "/k3s"
func Agent(config *config.Agent) error {
rand.Seed(time.Now().UTC().UnixNano())
......@@ -210,7 +209,7 @@ func checkCgroups() (kubeletRoot, runtimeRoot string, hasCFS, hasPIDs bool) {
last := parts[len(parts)-1]
i := strings.LastIndex(last, ".scope")
if i > 0 {
kubeletRoot = k3sCgroupRoot
kubeletRoot = "/" + version.Program
}
}
}
......@@ -238,8 +237,8 @@ func checkCgroups() (kubeletRoot, runtimeRoot string, hasCFS, hasPIDs bool) {
if system == "name=systemd" {
last := parts[len(parts)-1]
if last != "/" && last != "/init.scope" {
kubeletRoot = k3sCgroupRoot
runtimeRoot = k3sCgroupRoot
kubeletRoot = "/" + version.Program
runtimeRoot = "/" + version.Program
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment