Repository: opencontainers/runc (go)

Issue:
memory.numa_stat not always available
memory.numa_stat is not always available, observed on:
```
/sys/fs/cgroup/memory # cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.12.0
PRETTY_NAME="Alpine Linux v3.12"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"

/sys/fs/cgroup/memory # uname -sr
Linux 4.19.76-linuxkit
```
for details see: https://github.com/google/cadvisor/issues/2583

Pull request description:
Fix #2469 omit memory.numa_stat when not available
Signed-off-by: Katarzyna Kujawa <katarzyna.kujawa@intel.com>

Patch:
diff --git a/libcontainer/cgroups/fs/memory.go b/libcontainer/cgroups/fs/memory.go
index 95087690..f7b8f999 100644
--- a/libcontainer/cgroups/fs/memory.go
+++ b/libcontainer/cgroups/fs/memory.go
@@ -291,7 +291,9 @@ func getPageUsageByNUMA(cgroupPath string) (cgroups.PageUsageByNUMA, error) {
 	stats := cgroups.PageUsageByNUMA{}
 
 	file, err := os.Open(path.Join(cgroupPath, cgroupMemoryPagesByNuma))
-	if err != nil {
+	if os.IsNotExist(err) {
+		return stats, nil
+	} else if err != nil {
 		return stats, err
 	}
 


Test patch:
diff --git a/libcontainer/cgroups/fs/memory_test.go b/libcontainer/cgroups/fs/memory_test.go
index c84b4fe3..52244fc7 100644
--- a/libcontainer/cgroups/fs/memory_test.go
+++ b/libcontainer/cgroups/fs/memory_test.go
@@ -504,3 +504,14 @@ func TestNoHierarchicalNumaStat(t *testing.T) {
 	}
 	expectPageUsageByNUMAEquals(t, pageUsageByNUMA, actualStats)
 }
+
+func TestWithoutNumaStat(t *testing.T) {
+	helper := NewCgroupTestUtil("memory", t)
+	defer helper.cleanup()
+
+	actualStats, err := getPageUsageByNUMA(helper.CgroupPath)
+	if err != nil {
+		t.Fatal(err)
+	}
+	expectPageUsageByNUMAEquals(t, cgroups.PageUsageByNUMA{}, actualStats)
+}