Skip to content

Can't Create/Update an replicated service with replicas = 0, bug finded #1572

@niboo-ave

Description

@niboo-ave

I try to update a service with the following code:

 service.update(
            name=service.name,
            mode=docker.types.ServiceMode('replicated', replicas=0),
            networks=networks_list,
        )

First, I want to update the replicas only but I have to put name and network or the api think I want to change them (?) then send me an error.
Second, the ServiceMode object created here don't work and looks like this : {'replicated': {}}
The reason for this is https://github.com/docker/docker-py/blob/master/docker/types/services.py#L410 where the if should be an if exist.
I would love to do a pull request but i'm a newbie and I'm already lost with my first one : #1568
Thx for everything

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions