mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
Merge pull request #3537 from pre-commit/security-options-null
handle `SecurityOptions: null` in docker response
This commit is contained in:
commit
924680e974
2 changed files with 3 additions and 2 deletions
|
|
@ -115,7 +115,7 @@ def _is_rootless() -> bool: # pragma: win32 no cover
|
|||
return (
|
||||
# docker:
|
||||
# https://docs.docker.com/reference/api/engine/version/v1.48/#tag/System/operation/SystemInfo
|
||||
'name=rootless' in info.get('SecurityOptions', ()) or
|
||||
'name=rootless' in (info.get('SecurityOptions') or ()) or
|
||||
# podman:
|
||||
# https://docs.podman.io/en/latest/_static/api.html?version=v5.4#tag/system/operation/SystemInfoLibpod
|
||||
info['host']['security']['rootless']
|
||||
|
|
|
|||
|
|
@ -89,7 +89,8 @@ def test_docker_user_rootless(info_ret):
|
|||
(
|
||||
(0, b'{"SecurityOptions": ["name=cgroupns"]}', b''),
|
||||
(0, b'{"host": {"security": {"rootless": false}}}', b''),
|
||||
(0, b'{"respone_from_some_other_container_engine": true}', b''),
|
||||
(0, b'{"response_from_some_other_container_engine": true}', b''),
|
||||
(0, b'{"SecurityOptions": null}', b''),
|
||||
(1, b'', b''),
|
||||
),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue