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
0f70b6a3
Kaydet (Commit)
0f70b6a3
authored
Agu 04, 2016
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add support for custom name in SwarmSpec
Signed-off-by:
Joffrey F
<
joffrey@docker.com
>
üst
fdfe582b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
types.py
docker/utils/types.py
+4
-1
swarm.md
docs/swarm.md
+4
-0
swarm_test.py
tests/integration/swarm_test.py
+18
-0
No files found.
docker/utils/types.py
Dosyayı görüntüle @
0f70b6a3
...
...
@@ -101,7 +101,7 @@ class SwarmSpec(DictType):
snapshot_interval
=
None
,
keep_old_snapshots
=
None
,
log_entries_for_slow_followers
=
None
,
heartbeat_tick
=
None
,
election_tick
=
None
,
dispatcher_heartbeat_period
=
None
,
node_cert_expiry
=
None
,
external_ca
=
None
):
node_cert_expiry
=
None
,
external_ca
=
None
,
name
=
None
):
if
task_history_retention_limit
is
not
None
:
self
[
'Orchestration'
]
=
{
'TaskHistoryRetentionLimit'
:
task_history_retention_limit
...
...
@@ -127,6 +127,9 @@ class SwarmSpec(DictType):
'ExternalCA'
:
external_ca
}
if
name
is
not
None
:
self
[
'Name'
]
=
name
class
SwarmExternalCA
(
DictType
):
def
__init__
(
self
,
url
,
protocol
=
None
,
options
=
None
):
...
...
docs/swarm.md
Dosyayı görüntüle @
0f70b6a3
...
...
@@ -106,6 +106,7 @@ argument in `Client.init_swarm`.
*
node_cert_expiry (int): Automatic expiry for nodes certificates.
*
external_ca (dict): Configuration for forwarding signing requests to an
external certificate authority. Use
`docker.utils.SwarmExternalCA`
.
*
name (string): Swarm's name
**Returns:**
`docker.utils.SwarmSpec`
instance.
...
...
@@ -194,3 +195,6 @@ Update the Swarm's configuration
Default:
`None`
.
*
rotate_worker_token (bool): Rotate the worker join token. Default:
`False`
.
*
rotate_manager_token (bool): Rotate the manager join token. Default:
`False`
.
**Returns:**
`True`
if the request went through. Raises an
`APIError`
if it
fails.
tests/integration/swarm_test.py
Dosyayı görüntüle @
0f70b6a3
...
...
@@ -96,3 +96,21 @@ class SwarmTest(helpers.BaseTestCase):
swarm_info_1
[
'JoinTokens'
][
'Worker'
]
!=
swarm_info_2
[
'JoinTokens'
][
'Worker'
]
)
@requires_api_version
(
'1.24'
)
def
test_update_swarm_name
(
self
):
assert
self
.
client
.
init_swarm
(
'eth0'
)
swarm_info_1
=
self
.
client
.
inspect_swarm
()
spec
=
self
.
client
.
create_swarm_spec
(
node_cert_expiry
=
7776000000000000
,
name
=
'reimuhakurei'
)
assert
self
.
client
.
update_swarm
(
version
=
swarm_info_1
[
'Version'
][
'Index'
],
swarm_spec
=
spec
)
swarm_info_2
=
self
.
client
.
inspect_swarm
()
assert
(
swarm_info_1
[
'Version'
][
'Index'
]
!=
swarm_info_2
[
'Version'
][
'Index'
]
)
assert
swarm_info_2
[
'Spec'
][
'Name'
]
==
'reimuhakurei'
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