Do not fail container creation if the contaienr exits before applyting

oom score adjust.

Signed-off-by: Vishnu kannan <vishnuk@google.com>
This commit is contained in:
Vishnu kannan
2016-01-26 12:29:10 -08:00
parent ad9fa30e7e
commit df1f164b34
3 changed files with 62 additions and 26 deletions

View File

@@ -19,6 +19,7 @@ package procfs
import (
"fmt"
"io/ioutil"
"os"
"path"
"strconv"
"strings"
@@ -48,6 +49,9 @@ func (pfs *ProcFS) GetFullContainerName(pid int) (string, error) {
filePath := path.Join("/proc", strconv.Itoa(pid), "cgroup")
content, err := ioutil.ReadFile(filePath)
if err != nil {
if e, ok := err.(*os.SyscallError); ok && os.IsNotExist(e) {
return "", os.ErrNotExist
}
return "", err
}
return containerNameFromProcCgroup(string(content))