Commit ce09ce4a authored by EduRam's avatar EduRam Committed by Ian Lance Taylor

syscall: update check for UserNS support for CentOS 7.5+

Fixes #26385

Change-Id: I5594564f42898a71d30531e5132bddb3a6915247
GitHub-Last-Rev: fbd7b38b0419e21ecd22fe802ede5c0ee3f14a9a
GitHub-Pull-Request: golang/go#26427
Reviewed-on: https://go-review.googlesource.com/124555Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent f3cdc941
......@@ -84,6 +84,15 @@ func checkUserNS(t *testing.T) {
t.Skip("kernel doesn't support user namespaces")
}
}
// On Centos 7.5+, user namespaces are disabled if user.max_user_namespaces = 0
if _, err := os.Stat("/proc/sys/user/max_user_namespaces"); err == nil {
buf, errRead := ioutil.ReadFile("/proc/sys/user/max_user_namespaces")
if errRead == nil && buf[0] == '0' {
t.Skip("kernel doesn't support user namespaces")
}
}
// When running under the Go continuous build, skip tests for
// now when under Kubernetes. (where things are root but not quite)
// Both of these are our own environment variables.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment