diff --git a/Cargo.toml b/Cargo.toml index 1c48bf682..d35c45d32 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -83,7 +83,7 @@ tempfile = "3.1.0" thiserror = "2.0.3" tokio = "1.14.0" tokio-test = "0.4.0" -tokio-tungstenite = "0.24.0" +tokio-tungstenite = "0.26.1" tokio-util = "0.7.0" tower = "0.5.1" tower-http = "0.6.1" diff --git a/kube-client/src/api/portforward.rs b/kube-client/src/api/portforward.rs index 6439f9dc7..e28ffbc22 100644 --- a/kube-client/src/api/portforward.rs +++ b/kube-client/src/api/portforward.rs @@ -228,8 +228,7 @@ where .map_err(Error::ReceiveWebSocketMessage)? { match msg { - ws::Message::Binary(bin) if bin.len() > 1 => { - let mut bytes = Bytes::from(bin); + ws::Message::Binary(mut bytes) if bytes.len() > 1 => { let ch = bytes.split_to(1)[0]; sender .send(Message::FromPod(ch, bytes)) diff --git a/kube-client/src/api/remote_command.rs b/kube-client/src/api/remote_command.rs index a0a78572a..069ffb440 100644 --- a/kube-client/src/api/remote_command.rs +++ b/kube-client/src/api/remote_command.rs @@ -350,7 +350,7 @@ where let mut vec = Vec::with_capacity(new_size.len() + 1); vec.push(RESIZE_CHANNEL); vec.extend_from_slice(&new_size[..]); - server_send.send(ws::Message::Binary(vec)).await.map_err(Error::SendTerminalSize)?; + server_send.send(ws::Message::Binary(vec.into())).await.map_err(Error::SendTerminalSize)?; }, None => { have_terminal_size_rx = false; @@ -379,9 +379,9 @@ async fn filter_message(wsm: Result) -> Option 1 => match bin[0] { - STDOUT_CHANNEL => Some(Ok(Message::Stdout(bin))), - STDERR_CHANNEL => Some(Ok(Message::Stderr(bin))), - STATUS_CHANNEL => Some(Ok(Message::Status(bin))), + STDOUT_CHANNEL => Some(Ok(Message::Stdout(bin.into()))), + STDERR_CHANNEL => Some(Ok(Message::Stderr(bin.into()))), + STATUS_CHANNEL => Some(Ok(Message::Status(bin.into()))), // We don't receive messages to stdin and resize channels. _ => None, },