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
3caaa005
Kaydet (Commit)
3caaa005
authored
Agu 16, 2015
tarafından
Mohit Soni
Kaydeden (comit)
Joffrey F
Agu 24, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added support for cgroup parent
Clean up cgroup_parent usage
üst
4008cbce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
utils.py
docker/utils/utils.py
+4
-1
test.py
tests/test.py
+18
-0
No files found.
docker/utils/utils.py
Dosyayı görüntüle @
3caaa005
...
...
@@ -395,7 +395,7 @@ def create_host_config(
restart_policy
=
None
,
cap_add
=
None
,
cap_drop
=
None
,
devices
=
None
,
extra_hosts
=
None
,
read_only
=
None
,
pid_mode
=
None
,
ipc_mode
=
None
,
security_opt
=
None
,
ulimits
=
None
,
log_config
=
None
,
mem_limit
=
None
,
memswap_limit
=
None
memswap_limit
=
None
,
cgroup_parent
=
None
):
host_config
=
{}
...
...
@@ -500,6 +500,9 @@ def create_host_config(
if
lxc_conf
is
not
None
:
host_config
[
'LxcConf'
]
=
lxc_conf
if
cgroup_parent
is
not
None
:
host_config
[
'CgroupParent'
]
=
cgroup_parent
if
ulimits
is
not
None
:
if
not
isinstance
(
ulimits
,
list
):
raise
errors
.
DockerException
(
...
...
tests/test.py
Dosyayı görüntüle @
3caaa005
...
...
@@ -492,6 +492,24 @@ class DockerClientTest(Cleanup, base.BaseTestCase):
self
.
assertEqual
(
args
[
1
][
'headers'
],
{
'Content-Type'
:
'application/json'
})
def
test_create_container_with_cgroup_parent
(
self
):
try
:
self
.
client
.
create_container
(
'busybox'
,
'ls'
,
host_config
=
create_host_config
(
cgroup_parent
=
'test'
)
)
except
Exception
as
e
:
self
.
fail
(
'Command should not raise exception: {0}'
.
format
(
e
))
args
=
fake_request
.
call_args
self
.
assertEqual
(
args
[
0
][
0
],
url_prefix
+
'containers/create'
)
data
=
json
.
loads
(
args
[
1
][
'data'
])
self
.
assertIn
(
'HostConfig'
,
data
)
self
.
assertIn
(
'CgroupParent'
,
data
[
'HostConfig'
])
self
.
assertEqual
(
data
[
'HostConfig'
][
'CgroupParent'
],
'test'
)
def
test_create_container_with_working_dir
(
self
):
try
:
self
.
client
.
create_container
(
'busybox'
,
'ls'
,
...
...
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