Add support from device_cgroup_rules parameter (#910)

This commit is contained in:
Fran Jurinec
2024-07-04 09:51:32 +02:00
committed by GitHub
parent 7fe2f57951
commit 9b5dbd4543
5 changed files with 77 additions and 0 deletions
@@ -895,6 +895,11 @@ OPTION_DEVICE_REQUESTS = (
))
)
OPTION_DEVICE_CGROUP_RULES = (
OptionGroup()
.add_option('device_cgroup_rules', type='list', elements='str')
)
OPTION_DNS_SERVERS = (
OptionGroup()
.add_option('dns_servers', type='list', elements='str')
@@ -1194,6 +1199,7 @@ OPTIONS = [
OPTION_DEVICE_READ_IOPS,
OPTION_DEVICE_WRITE_IOPS,
OPTION_DEVICE_REQUESTS,
OPTION_DEVICE_CGROUP_RULES,
OPTION_DNS_SERVERS,
OPTION_DNS_OPTS,
OPTION_DNS_SEARCH_DOMAINS,
@@ -44,6 +44,7 @@ from ansible_collections.community.docker.plugins.module_utils.module_container.
OPTION_DEVICE_READ_IOPS,
OPTION_DEVICE_WRITE_IOPS,
OPTION_DEVICE_REQUESTS,
OPTION_DEVICE_CGROUP_RULES,
OPTION_DNS_SERVERS,
OPTION_DNS_OPTS,
OPTION_DNS_SEARCH_DOMAINS,
@@ -1290,6 +1291,8 @@ OPTION_DEVICE_WRITE_IOPS.add_engine('docker_api', DockerAPIEngine.host_config_va
OPTION_DEVICE_REQUESTS.add_engine('docker_api', DockerAPIEngine.host_config_value(
'DeviceRequests', min_api_version='1.40', preprocess_value=_preprocess_device_requests))
OPTION_DEVICE_CGROUP_RULES.add_engine('docker_api', DockerAPIEngine.host_config_value('DeviceCgroupRules', min_api_version='1.28'))
OPTION_DNS_SERVERS.add_engine('docker_api', DockerAPIEngine.host_config_value('Dns'))
OPTION_DNS_OPTS.add_engine('docker_api', DockerAPIEngine.host_config_value('DnsOptions'))