From 68a46a4efb09c0ed0a2c16f37b76059afcfbe0b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 08:02:39 +0000 Subject: [PATCH] Update tokio-tungstenite requirement from 0.24.0 to 0.25.0 (#1666) * Update tokio-tungstenite requirement from 0.24.0 to 0.25.0 Updates the requirements on [tokio-tungstenite](https://github.com/snapview/tokio-tungstenite) to permit the latest version. - [Changelog](https://github.com/snapview/tokio-tungstenite/blob/master/CHANGELOG.md) - [Commits](https://github.com/snapview/tokio-tungstenite/compare/v0.24.0...v0.24.0) --- updated-dependencies: - dependency-name: tokio-tungstenite dependency-type: direct:production ... Signed-off-by: dependabot[bot] * add some into calls to fix upgrade Signed-off-by: clux * fix clippy lint on useless from Signed-off-by: clux --------- Signed-off-by: dependabot[bot] Signed-off-by: clux Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: clux --- Cargo.toml | 2 +- kube-client/src/api/portforward.rs | 3 +-- kube-client/src/api/remote_command.rs | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) 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, },