This commit is contained in:
Jonathan Hettwer 2025-01-18 23:58:38 -05:00 committed by GitHub
commit 6cf912f009
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 2 deletions

View File

@ -552,8 +552,13 @@ class HostConfig(dict):
if version_lt(version, '1.23'):
raise host_config_version_error('userns_mode', '1.23')
if userns_mode != "host":
raise host_config_value_error("userns_mode", userns_mode)
# Do not check that userns_mode has a specific value, i.e. 'host'
# since more complex values might be supported by the daemon exposing
# the docker api, e.g. podman also supports 'keep-id'
if not isinstance(userns_mode, str):
raise host_config_type_error('userns_mode', userns_mode, 'string')
self['UsernsMode'] = userns_mode
if uts_mode: