Skip to content

websocket doesn't filter by streams #725

@lshamis

Description

@lshamis

Long story short

websocket doesn't filter by stream as args would suggest.

async def websocket(self, **params):

async def websocket(self, **params):
    if not params:
        params = {"stdin": True, "stdout": True, "stderr": True, "stream": True}
    ...
  • Expected behaviour:
ws_out = await proc.websocket(stdin=False, stdout=True, stderr=False, stream=True)
ws_err = await proc.websocket(stdin=False, stdout=False, stderr=True, stream=True)

# proc prints "foobar" to stdout

msg = await ws_out.receive()  # msg.data == b"foobar"
msg = await ws_err.receive()  # msg.data != b"foobar"
  • Actual behaviour:
msg = await ws_err.receive()  # msg.data == b"foobar"

How to reproduce

Get/Build a docker image that prints anything to stdout. Then

docker = aiodocker.Docker()
proc = await docker.containers.create_or_replace(name, config)
ws_out = await proc.websocket(stdin=False, stdout=True, stderr=False, stream=True)
ws_err = await proc.websocket(stdin=False, stdout=False, stderr=True, stream=True)
await proc.start()
print(await ws_err.receive())

Your environment

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions