Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
docker-py
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
docker-py
Commits
b3d2e54a
Unverified
Kaydet (Commit)
b3d2e54a
authored
Haz 29, 2018
tarafından
Joffrey F
Kaydeden (comit)
GitHub
Haz 29, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #2063 from mtszb/master
Add support for `uts_mode` parameter in `Client.create_host_config`.
üst
cb19bf11
098318ad
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
5 deletions
+31
-5
container.py
docker/api/container.py
+2
-0
containers.py
docker/models/containers.py
+1
-0
containers.py
docker/types/containers.py
+10
-5
api_container_test.py
tests/integration/api_container_test.py
+10
-0
dockertypes_test.py
tests/unit/dockertypes_test.py
+6
-0
models_containers_test.py
tests/unit/models_containers_test.py
+2
-0
No files found.
docker/api/container.py
Dosyayı görüntüle @
b3d2e54a
...
...
@@ -547,6 +547,8 @@ class ContainerApiMixin(object):
userns_mode (str): Sets the user namespace mode for the container
when user namespace remapping option is enabled. Supported
values are: ``host``
uts_mode (str): Sets the UTS namespace mode for the container.
Supported values are: ``host``
volumes_from (:py:class:`list`): List of container names or IDs to
get volumes from.
runtime (str): Runtime to use with this container.
...
...
docker/models/containers.py
Dosyayı görüntüle @
b3d2e54a
...
...
@@ -995,6 +995,7 @@ RUN_HOST_CONFIG_KWARGS = [
'tmpfs'
,
'ulimits'
,
'userns_mode'
,
'uts_mode'
,
'version'
,
'volumes_from'
,
'runtime'
...
...
docker/types/containers.py
Dosyayı görüntüle @
b3d2e54a
...
...
@@ -115,11 +115,11 @@ class HostConfig(dict):
device_read_iops
=
None
,
device_write_iops
=
None
,
oom_kill_disable
=
False
,
shm_size
=
None
,
sysctls
=
None
,
tmpfs
=
None
,
oom_score_adj
=
None
,
dns_opt
=
None
,
cpu_shares
=
None
,
cpuset_cpus
=
None
,
userns_mode
=
None
,
pids_limit
=
None
,
isolation
=
None
,
auto_remove
=
False
,
storage_opt
=
Non
e
,
init
=
None
,
init_path
=
None
,
volume_driver
=
None
,
cpu_count
=
None
,
cpu_percent
=
None
,
nano_cpus
=
None
,
cpuset_mems
=
None
,
runtime
=
None
,
mounts
=
None
,
cpuset_cpus
=
None
,
userns_mode
=
None
,
uts_mode
=
None
,
pids_limit
=
None
,
isolation
=
None
,
auto_remove
=
Fals
e
,
storage_opt
=
None
,
init
=
None
,
init_path
=
None
,
volume_driver
=
None
,
cpu_count
=
None
,
cpu_percent
=
None
,
nano_cpus
=
None
,
cpuset_mems
=
None
,
runtime
=
None
,
mounts
=
None
,
cpu_rt_period
=
None
,
cpu_rt_runtime
=
None
,
device_cgroup_rules
=
None
):
...
...
@@ -392,6 +392,11 @@ class HostConfig(dict):
raise
host_config_value_error
(
"userns_mode"
,
userns_mode
)
self
[
'UsernsMode'
]
=
userns_mode
if
uts_mode
:
if
uts_mode
!=
"host"
:
raise
host_config_value_error
(
"uts_mode"
,
uts_mode
)
self
[
'UTSMode'
]
=
uts_mode
if
pids_limit
:
if
not
isinstance
(
pids_limit
,
int
):
raise
host_config_type_error
(
'pids_limit'
,
pids_limit
,
'int'
)
...
...
tests/integration/api_container_test.py
Dosyayı görüntüle @
b3d2e54a
...
...
@@ -490,6 +490,16 @@ class CreateContainerTest(BaseAPIIntegrationTest):
self
.
client
.
start
(
ctnr
)
assert
rule
in
self
.
client
.
logs
(
ctnr
)
.
decode
(
'utf-8'
)
def
test_create_with_uts_mode
(
self
):
container
=
self
.
client
.
create_container
(
BUSYBOX
,
[
'echo'
],
host_config
=
self
.
client
.
create_host_config
(
uts_mode
=
'host'
)
)
self
.
tmp_containers
.
append
(
container
)
config
=
self
.
client
.
inspect_container
(
container
)
assert
config
[
'HostConfig'
][
'UTSMode'
]
==
'host'
@pytest.mark.xfail
(
IS_WINDOWS_PLATFORM
,
reason
=
'Test not designed for Windows platform'
...
...
tests/unit/dockertypes_test.py
Dosyayı görüntüle @
b3d2e54a
...
...
@@ -85,6 +85,12 @@ class HostConfigTest(unittest.TestCase):
with
pytest
.
raises
(
ValueError
):
create_host_config
(
version
=
'1.23'
,
userns_mode
=
'host12'
)
def
test_create_host_config_with_uts
(
self
):
config
=
create_host_config
(
version
=
'1.15'
,
uts_mode
=
'host'
)
assert
config
.
get
(
'UTSMode'
)
==
'host'
with
pytest
.
raises
(
ValueError
):
create_host_config
(
version
=
'1.15'
,
uts_mode
=
'host12'
)
def
test_create_host_config_with_oom_score_adj
(
self
):
config
=
create_host_config
(
version
=
'1.22'
,
oom_score_adj
=
100
)
assert
config
.
get
(
'OomScoreAdj'
)
==
100
...
...
tests/unit/models_containers_test.py
Dosyayı görüntüle @
b3d2e54a
...
...
@@ -95,6 +95,7 @@ class ContainerCollectionTest(unittest.TestCase):
ulimits
=
[{
"Name"
:
"nofile"
,
"Soft"
:
1024
,
"Hard"
:
2048
}],
user
=
'bob'
,
userns_mode
=
'host'
,
uts_mode
=
'host'
,
version
=
'1.23'
,
volume_driver
=
'some_driver'
,
volumes
=
[
...
...
@@ -174,6 +175,7 @@ class ContainerCollectionTest(unittest.TestCase):
'Tmpfs'
:
{
'/blah'
:
''
},
'Ulimits'
:
[{
"Name"
:
"nofile"
,
"Soft"
:
1024
,
"Hard"
:
2048
}],
'UsernsMode'
:
'host'
,
'UTSMode'
:
'host'
,
'VolumesFrom'
:
[
'container'
],
},
healthcheck
=
{
'test'
:
'true'
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment