aiodocker
aiodocker copied to clipboard
aiodocker.swarm.join() doesn't encode data as JSON
Long story short
The aiodocker.swarm.join() function forms a dict as the data parameter for a call to swarm/join, but then calls the _query() function instead of the _query_json() function. The data doesn't get converted to JSON, resulting in an error from the target Docker engine.
- Expected behaviour: Calling aiodocker.swarm.join() should join the remote engine to a swarm.
- Actual behaviour: The remote engine returns a JSON data decode error.
How to reproduce
join_token = 'SWMTKN-1-1234567890abcdefghij1234567890abcdefghijklmnopqrst-0987654321234567890987654'
target_docker = aiodocker.docker.Docker(url=f'tcp://10.0.0.1:2376')
await target_docker.swarm.join(remote_addrs=(f'10.0.0.2:2377',), join_token=join_token, listen_addr='eth0:2377')
Your environment
Using aiodocker==0.14.0
GitMate.io thinks possibly related issues are https://github.com/aio-libs/aiodocker/issues/172 (auth with registry doesn't work), https://github.com/aio-libs/aiodocker/issues/211 (New aiodocker release request), and https://github.com/aio-libs/aiodocker/issues/101 (Build from remote host doesn't work on Docker 17.03 / API 1.27).