containerd / rust-extensions

Rust crates to extend containerd
https://containerd.io
Apache License 2.0
184 stars 73 forks source link

containerd-client connect failed when toinc with tls feature #261

Closed fcfangcc closed 6 months ago

fcfangcc commented 7 months ago

containerd-client connect failed when toinc with tls feature(Other deps need. )

called `Result::unwrap()` on an `Err` value: tonic::transport::Error(Transport, hyper::Error(Connect, HttpsUriWithoutTlsSupport(())))

example

use containerd_client::{connect};

async fn test()  {
    let channel = connect("/run/containerd/containerd.sock").await.unwrap();
}

#[tokio::main]
async fn main() {
    test().await;
}

Failed Cargo.toml

[dependencies]
tokio = { version = "1.37.0", features = ["full"] }
tower = "0.4"
tonic = { version = "0.11", default-features = false, features = ["default","transport", "codegen", "prost", "tls", "tls-roots", "gzip","tls-roots-common","tls-webpki-roots","channel"] }
containerd-client = { version="0.5" }

Success Cargo.toml

[dependencies]
tokio = { version = "1.37.0", features = ["full"] }
tower = "0.4"
tonic = { version = "0.11"}
containerd-client = { version="0.5" }
mxpv commented 7 months ago

We probably should tls feature with proper tonic dependencies to address this.

Do you want to make a PR?