improve work with Kubernetes

This commit is contained in:
Harduino
2021-02-25 14:27:15 +03:00
parent 1648a8921c
commit 9fe6906622
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -106,7 +106,7 @@ func getThisContainerId() {
}
if fCol != "" {
cmd := fmt.Sprintf("cat /proc/self/cgroup | grep memory | tail -1 | cut -d/ -f%s", fCol)
cmd := fmt.Sprintf("cat /proc/self/cgroup | grep memory | tail -1 | cut -d/ -f%s | grep -o -E '[0-9A-z]{64}'", fCol)
out, err := exec.Command("bash", "-c", cmd).Output()
if err == nil {
containerId = strings.TrimSpace(string(out))