aio-libs / aiodocker

Python Docker API client based on asyncio and aiohttp
Other
435 stars 98 forks source link

aiodocker.swarm.join() doesn't encode data as JSON #288

Open kinghuang opened 5 years ago

kinghuang commented 5 years ago

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.

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

aio-libs-bot commented 5 years ago

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).