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
797f1edc
Kaydet (Commit)
797f1edc
authored
Agu 23, 2016
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge branch 'master' of
https://github.com/srikalyan/docker-py
into srikalyan-master
üst
3709c709
b5d3556b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
3 deletions
+22
-3
utils.py
docker/utils/utils.py
+9
-1
hostconfig.md
docs/hostconfig.md
+3
-1
utils_test.py
tests/unit/utils_test.py
+10
-1
No files found.
docker/utils/utils.py
Dosyayı görüntüle @
797f1edc
...
@@ -621,7 +621,7 @@ def create_host_config(binds=None, port_bindings=None, lxc_conf=None,
...
@@ -621,7 +621,7 @@ def create_host_config(binds=None, port_bindings=None, lxc_conf=None,
device_write_iops
=
None
,
oom_kill_disable
=
False
,
device_write_iops
=
None
,
oom_kill_disable
=
False
,
shm_size
=
None
,
sysctls
=
None
,
version
=
None
,
tmpfs
=
None
,
shm_size
=
None
,
sysctls
=
None
,
version
=
None
,
tmpfs
=
None
,
oom_score_adj
=
None
,
dns_opt
=
None
,
cpu_shares
=
None
,
oom_score_adj
=
None
,
dns_opt
=
None
,
cpu_shares
=
None
,
cpuset_cpus
=
None
):
cpuset_cpus
=
None
,
userns_mode
=
None
):
host_config
=
{}
host_config
=
{}
...
@@ -882,6 +882,14 @@ def create_host_config(binds=None, port_bindings=None, lxc_conf=None,
...
@@ -882,6 +882,14 @@ def create_host_config(binds=None, port_bindings=None, lxc_conf=None,
raise
host_config_version_error
(
'tmpfs'
,
'1.22'
)
raise
host_config_version_error
(
'tmpfs'
,
'1.22'
)
host_config
[
"Tmpfs"
]
=
convert_tmpfs_mounts
(
tmpfs
)
host_config
[
"Tmpfs"
]
=
convert_tmpfs_mounts
(
tmpfs
)
if
userns_mode
:
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
)
host_config
[
'UsernsMode'
]
=
userns_mode
return
host_config
return
host_config
...
...
docs/hostconfig.md
Dosyayı görüntüle @
797f1edc
...
@@ -123,9 +123,11 @@ for example:
...
@@ -123,9 +123,11 @@ for example:
container process will run as.
container process will run as.
*
devices (list): Host device bindings. See
[
host devices
](
host-devices.md
)
*
devices (list): Host device bindings. See
[
host devices
](
host-devices.md
)
for more information.
for more information.
*
tmpfs: Temporary filesystems to mou
u
nt. See
[
Using tmpfs
](
tmpfs.md
)
for more
*
tmpfs: Temporary filesystems to mount. See
[
Using tmpfs
](
tmpfs.md
)
for more
information.
information.
*
sysctls (dict): Kernel parameters to set in the container.
*
sysctls (dict): Kernel parameters to set in the container.
*
userns_mode (str): Sets the user namespace mode for the container when user
namespace remapping option is enabled. Supported values are:
`host`
**Returns**
(dict) HostConfig dictionary
**Returns**
(dict) HostConfig dictionary
...
...
tests/unit/utils_test.py
Dosyayı görüntüle @
797f1edc
...
@@ -131,6 +131,16 @@ class HostConfigTest(base.BaseTestCase):
...
@@ -131,6 +131,16 @@ class HostConfigTest(base.BaseTestCase):
InvalidVersion
,
lambda
:
create_host_config
(
version
=
'1.18.3'
,
InvalidVersion
,
lambda
:
create_host_config
(
version
=
'1.18.3'
,
oom_kill_disable
=
True
))
oom_kill_disable
=
True
))
def
test_create_host_config_with_userns_mode
(
self
):
config
=
create_host_config
(
version
=
'1.23'
,
userns_mode
=
'host'
)
self
.
assertEqual
(
config
.
get
(
'UsernsMode'
),
'host'
)
self
.
assertRaises
(
InvalidVersion
,
lambda
:
create_host_config
(
version
=
'1.22'
,
userns_mode
=
'host'
))
self
.
assertRaises
(
ValueError
,
lambda
:
create_host_config
(
version
=
'1.23'
,
userns_mode
=
'host12'
))
def
test_create_host_config_with_oom_score_adj
(
self
):
def
test_create_host_config_with_oom_score_adj
(
self
):
config
=
create_host_config
(
version
=
'1.22'
,
oom_score_adj
=
100
)
config
=
create_host_config
(
version
=
'1.22'
,
oom_score_adj
=
100
)
self
.
assertEqual
(
config
.
get
(
'OomScoreAdj'
),
100
)
self
.
assertEqual
(
config
.
get
(
'OomScoreAdj'
),
100
)
...
@@ -656,7 +666,6 @@ class UtilsTest(base.BaseTestCase):
...
@@ -656,7 +666,6 @@ class UtilsTest(base.BaseTestCase):
class
SplitCommandTest
(
base
.
BaseTestCase
):
class
SplitCommandTest
(
base
.
BaseTestCase
):
def
test_split_command_with_unicode
(
self
):
def
test_split_command_with_unicode
(
self
):
self
.
assertEqual
(
split_command
(
u'echo μμ'
),
[
'echo'
,
'μμ'
])
self
.
assertEqual
(
split_command
(
u'echo μμ'
),
[
'echo'
,
'μμ'
])
...
...
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