Services Documentation Error
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 13d 8h
- Merged PRs (30d)
- 2
Description
Problem:
Apparently the return type in the documentation does not match the actual type that is returned when using Service.scale() method. If you look at here it is stated that it will return a bool. However, when you actually call the function it will return a dictionary. I don't know what this dictionary relates to otherwise I'd be glad to fix it myself and make pull-request. Thanks for your awesome support!
How to replicate:
steps:
- Create a sample service like a Redis service:
docker service create --name redis-service redis - Run python (make sure you have installed docker SDK before)
- Follow the process below:
import docker
client = docker.client.from_env()
service = client.services.get("redis-service")
res = service.scale(3)
print(res)
### This is what you'll get: {'Warning': None}
### but in the documentation it is stated that it will return a boolean value
Here are my environment specs when I tested this:
Environment:
- Docker SDK Version: 4.2.0
- DockerDaemon Version: 18.09.07
- OS: Ubuntu Server 18.04 LTS
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with docker/models/services.py at the documented Service.scale() method and reproduce the issue using the supplied Docker service and Python example. Compare the documented return type with the observed {'Warning': None} result and trace what that response represents. Done means the documentation accurately describes the returned value and its meaning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- api, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100