Skip to content

Migrate to v5.channels.k8s.io protocol #403

@GlassOfWhiskey

Description

@GlassOfWhiskey

In order to use the newly introduced CLOSE message, I needed to use the latest version of the WebSocket protocol (see kubernetes/kubernetes#119157). I simply did it by passing the proper header to the connect_get_namespaced_pod_exec method

response = await self.client_ws.connect_get_namespaced_pod_exec(
    name=pod,
    namespace=self.namespace or "default",
    container=container,
    command=command,
    stderr=True,
    stdin=True,
    stdout=True,
    tty=False,
    _headers={"sec-websocket-protocol": "v5.channels.k8s.io"},
    _preload_content=False,
)

However, I was wondering if it could be useful to make the latest version of the protocol the default one for this client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions