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.
In order to use the newly introduced
CLOSEmessage, 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 theconnect_get_namespaced_pod_execmethodHowever, I was wondering if it could be useful to make the latest version of the protocol the default one for this client.