1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-05 08:50:13 +00:00

Update to k8s v1.20

This commit is contained in:
Darren Shepherd
2020-12-08 16:32:23 -07:00
parent e70f5ca388
commit 68f1d2e966
937 changed files with 126796 additions and 35141 deletions

View File

@@ -134,6 +134,27 @@ func (p Proc) CmdLine() ([]string, error) {
return strings.Split(string(bytes.TrimRight(data, string("\x00"))), string(byte(0))), nil
}
// Wchan returns the wchan (wait channel) of a process.
func (p Proc) Wchan() (string, error) {
f, err := os.Open(p.path("wchan"))
if err != nil {
return "", err
}
defer f.Close()
data, err := ioutil.ReadAll(f)
if err != nil {
return "", err
}
wchan := string(data)
if wchan == "" || wchan == "0" {
return "", nil
}
return wchan, nil
}
// Comm returns the command name of a process.
func (p Proc) Comm() (string, error) {
data, err := util.ReadFileNoStat(p.path("comm"))