From 91e77928ab97e98b77214d4fec8e08950f482ddb Mon Sep 17 00:00:00 2001 From: Aviram Hassan Date: Fri, 4 Oct 2024 14:17:40 +0300 Subject: [PATCH] bump tonic,prost (#24) * bump versions * bump tonic,prost --- Cargo.toml | 7 ++++--- build.rs | 4 ++-- src/lib.rs | 7 +++++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 05f9240..4f89937 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,15 +12,16 @@ documentation = "https://docs.rs/crate/k8s-cri" readme = "README.md" [dependencies] -tonic = { version = "0.11"} -prost = "0.12" +tonic = { version = "0.12"} +prost = "0.13" serde = { version = "1.0", features = ["derive"] } [build-dependencies.tonic-build] -version = "0.11" +version = "0.12" default-features = false features = ["prost", "transport"] [dev-dependencies] tokio = { version = "1.37", features = [ "rt-multi-thread", "macros" ] } tower = "0.4" +hyper-util = "0.1.9" \ No newline at end of file diff --git a/build.rs b/build.rs index b87c594..abfd509 100644 --- a/build.rs +++ b/build.rs @@ -1,11 +1,11 @@ fn main() { tonic_build::configure() .type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]") - .compile(&["proto/v1.proto"], &["proto/"]) + .compile_protos(&["proto/v1.proto"], &["proto/"]) .unwrap(); tonic_build::configure() .type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]") - .compile(&["proto/v1alpha2.proto"], &["proto/"]) + .compile_protos(&["proto/v1alpha2.proto"], &["proto/"]) .unwrap(); } diff --git a/src/lib.rs b/src/lib.rs index 2284360..ba2c6fe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -32,15 +32,18 @@ //! //! use k8s_cri::v1alpha2::runtime_service_client::RuntimeServiceClient; //! use tokio::net::UnixStream; +//! use hyper_util::rt::TokioIo; //! use tonic::transport::{Channel, Endpoint, Uri}; //! use tower::service_fn; //! //! #[tokio::main] //! async fn main() { -//! let path = "/run/containerd/containerd.sock"; //! let channel = Endpoint::try_from("http://[::]") //! .unwrap() -//! .connect_with_connector(service_fn(move |_: Uri| UnixStream::connect(path))) +//! .connect_with_connector(service_fn(|_: Uri| async { +//! let path = "/run/containerd/containerd.sock"; +//! Ok::<_, std::io::Error>(TokioIo::new(UnixStream::connect(path).await?)) +//! })) //! .await //! .expect("Could not create client."); //!