mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
Remove kubelet dependency on pkill
Issue #26093 identified pkill as one of the dependencies of kublet which could be worked around. Build on the code introduced for pidof and regexp for the process(es) we need to send a signal to. Related to #26093
This commit is contained in:
@@ -27,6 +27,8 @@ import (
|
||||
"github.com/golang/glog"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
"k8s.io/kubernetes/pkg/util/iptables"
|
||||
"k8s.io/kubernetes/pkg/util/procfs"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
var cidrRegexp = regexp.MustCompile(`inet ([0-9a-fA-F.:]*/[0-9]*)`)
|
||||
@@ -54,7 +56,7 @@ func createCBR0(wantCIDR *net.IPNet, babysitDaemons bool) error {
|
||||
// For now just log the error. The containerRuntime check will catch docker failures.
|
||||
// TODO (dawnchen) figure out what we should do for rkt here.
|
||||
if babysitDaemons {
|
||||
if err := exec.Command("pkill", "-KILL", "docker").Run(); err != nil {
|
||||
if err := procfs.PKill("docker", syscall.SIGKILL); err != nil {
|
||||
glog.Error(err)
|
||||
}
|
||||
} else if util.UsingSystemdInitSystem() {
|
||||
|
||||
Reference in New Issue
Block a user