sys - add IsRunningOnPod
This commit is contained in:
parent
e88b75c71f
commit
ef88ea018c
|
@ -142,3 +142,8 @@ func HandleSigKill(done chan os.Signal) {
|
|||
os.Exit(0)
|
||||
}()
|
||||
}
|
||||
|
||||
func IsRunningOnPod() bool {
|
||||
var bufout bytes.Buffer
|
||||
return PipeCmd(exec.Command("cat", "/proc/1/cgroup"), exec.Command("grep", "kubepods"), &bufout) == 0
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user