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
b5d3556b
Kaydet (Commit)
b5d3556b
authored
Haz 30, 2016
tarafından
Srikalyan Swayampakula
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added support for user namespace.
Signed-off-by:
Srikalyan Swayampakula
<
srikalyansswayam@gmail.com
>
üst
94f8dd31
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
2 deletions
+21
-2
utils.py
docker/utils/utils.py
+9
-1
hostconfig.md
docs/hostconfig.md
+2
-0
utils_test.py
tests/unit/utils_test.py
+10
-1
No files found.
docker/utils/utils.py
Dosyayı görüntüle @
b5d3556b
...
@@ -620,7 +620,7 @@ def create_host_config(binds=None, port_bindings=None, lxc_conf=None,
...
@@ -620,7 +620,7 @@ def create_host_config(binds=None, port_bindings=None, lxc_conf=None,
device_write_bps
=
None
,
device_read_iops
=
None
,
device_write_bps
=
None
,
device_read_iops
=
None
,
device_write_iops
=
None
,
oom_kill_disable
=
False
,
device_write_iops
=
None
,
oom_kill_disable
=
False
,
shm_size
=
None
,
version
=
None
,
tmpfs
=
None
,
shm_size
=
None
,
version
=
None
,
tmpfs
=
None
,
oom_score_adj
=
None
):
oom_score_adj
=
None
,
userns_mode
=
None
):
host_config
=
{}
host_config
=
{}
...
@@ -853,6 +853,14 @@ def create_host_config(binds=None, port_bindings=None, lxc_conf=None,
...
@@ -853,6 +853,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 @
b5d3556b
...
@@ -123,6 +123,8 @@ for example:
...
@@ -123,6 +123,8 @@ for example:
for more information.
for more information.
*
tmpfs: Temporary filesystems to mouunt. See
[
Using tmpfs
](
tmpfs.md
)
for more
*
tmpfs: Temporary filesystems to mouunt. See
[
Using tmpfs
](
tmpfs.md
)
for more
information.
information.
*
userns_mode: 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 @
b5d3556b
...
@@ -98,6 +98,16 @@ class HostConfigTest(base.BaseTestCase):
...
@@ -98,6 +98,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
)
...
@@ -602,7 +612,6 @@ class UtilsTest(base.BaseTestCase):
...
@@ -602,7 +612,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