1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/integration
Sebastiaan van Stijn a826ca3aef
daemon.WithCommonOptions() fix detection of user-namespaces
Commit dae652e2e5 added support for non-privileged
containers to use ICMP_PROTO (used for `ping`). This option cannot be set for
containers that have user-namespaces enabled.

However, the detection looks to be incorrect; HostConfig.UsernsMode was added
in 6993e891d1 / ee2183881b,
and the property only has meaning if the daemon is running with user namespaces
enabled. In other situations, the property has no meaning.
As a result of the above, the sysctl would only be set for containers running
with UsernsMode=host on a daemon running with user-namespaces enabled.

This patch adds a check if the daemon has user-namespaces enabled (RemappedRoot
having a non-empty value), or if the daemon is running inside a user namespace
(e.g. rootless mode) to fix the detection.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-30 19:48:29 +02:00
..
build refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
config Add configuration validation option and tests. 2021-06-23 09:54:55 +00:00
container daemon.WithCommonOptions() fix detection of user-namespaces 2021-08-30 19:48:29 +02:00
daemon refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
distribution bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
image refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
internal Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
network Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
plugin refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
secret integration/secret: add check for empty list not producing an error 2020-04-14 18:31:36 +02:00
service refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
session bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
system Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
testdata/https Update test certificates 2021-05-18 09:43:21 +02:00
volume integration: copy loop variable into parallel test closures 2021-07-22 22:46:12 +02:00
doc.go Add canonical import comment 2018-02-05 16:51:57 -05:00