Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax checking of userns_mode to allow supplying e.g. keep-id as config #3230

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docker/types/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,13 @@ def __init__(self, version, binds=None, port_bindings=None,
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:
Expand Down