Merge pull request #2279 from masters-of-cats/freezer

Actually check for syscall.ENODEV when checking if a container is paused
This commit is contained in:
Michael Crosby 2020-03-31 14:59:20 -04:00 committed by GitHub
commit 8221d999f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -1832,7 +1832,10 @@ func (c *linuxContainer) isPaused() (bool, error) {
data, err := ioutil.ReadFile(filepath.Join(fcg, filename))
if err != nil {
// If freezer cgroup is not mounted, the container would just be not paused.
if os.IsNotExist(err) || err == syscall.ENODEV {
if os.IsNotExist(err) {
return false, nil
}
if pathError, isPathError := err.(*os.PathError); isPathError && pathError.Err == syscall.ENODEV {
return false, nil
}
return false, newSystemErrorWithCause(err, "checking if container is paused")