Revert "Support for docker.types.Placement.MaxReplicas (new in API 1.40) in Docker Swarm Service"

This reverts commit b701d5c999.
This commit is contained in:
aiordache 2021-02-15 15:49:01 +01:00
parent aa2ea7f7d5
commit 93e02ab207
2 changed files with 1 additions and 8 deletions

View File

@ -157,8 +157,6 @@ class ServiceCollection(Collection):
constraints. constraints.
preferences (list of tuple): :py:class:`~docker.types.Placement` preferences (list of tuple): :py:class:`~docker.types.Placement`
preferences. preferences.
maxreplicas (int): :py:class:`~docker.types.Placement` maxreplicas
or (int) representing maximum number of replicas per node.
platforms (list of tuple): A list of platform constraints platforms (list of tuple): A list of platform constraints
expressed as ``(arch, os)`` tuples. expressed as ``(arch, os)`` tuples.
container_labels (dict): Labels to apply to the container. container_labels (dict): Labels to apply to the container.
@ -321,7 +319,6 @@ PLACEMENT_KWARGS = [
'constraints', 'constraints',
'preferences', 'preferences',
'platforms', 'platforms',
'maxreplicas',
] ]

View File

@ -659,12 +659,10 @@ class Placement(dict):
are provided in order from highest to lowest precedence and are provided in order from highest to lowest precedence and
are expressed as ``(strategy, descriptor)`` tuples. See are expressed as ``(strategy, descriptor)`` tuples. See
:py:class:`PlacementPreference` for details. :py:class:`PlacementPreference` for details.
maxreplicas (int): Maximum number of replicas per node
platforms (:py:class:`list` of tuple): A list of platforms platforms (:py:class:`list` of tuple): A list of platforms
expressed as ``(arch, os)`` tuples expressed as ``(arch, os)`` tuples
""" """
def __init__(self, constraints=None, preferences=None, maxreplicas=None, def __init__(self, constraints=None, preferences=None, platforms=None):
platforms=None):
if constraints is not None: if constraints is not None:
self['Constraints'] = constraints self['Constraints'] = constraints
if preferences is not None: if preferences is not None:
@ -673,8 +671,6 @@ class Placement(dict):
if isinstance(pref, tuple): if isinstance(pref, tuple):
pref = PlacementPreference(*pref) pref = PlacementPreference(*pref)
self['Preferences'].append(pref) self['Preferences'].append(pref)
if maxreplicas is not None:
self['MaxReplicas'] = maxreplicas
if platforms: if platforms:
self['Platforms'] = [] self['Platforms'] = []
for plat in platforms: for plat in platforms: