Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid dnsname when using Client::try_default() #596

Closed
andreclaudino opened this issue Jul 21, 2021 · 4 comments
Closed

invalid dnsname when using Client::try_default() #596

andreclaudino opened this issue Jul 21, 2021 · 4 comments
Labels
client http issues with the client duplicate This issue or pull request already exists rustls rustls-tls related

Comments

@andreclaudino
Copy link

Hi! I am following a simple example for listing pods, using Client::try_default() to instantiate the client, then listing pods in a namespace. The code is:

use k8s_openapi::api::core::v1::Pod;
use kube::{Client, api::{Api, ListParams}};
use simple_result::SimpleResult;

#[tokio::main]
async fn main() -> SimpleResult<()> {

    let namespace = "kubeflow";
    
    let client = Client::try_default().await?;

    let api = Api::<Pod>::namespaced(client.clone(), &namespace);

    let pods = api.list(&ListParams::default()).await?;

    for pod in pods {
        let new_pod = pod.clone();
        println!("{}, {:?}", new_pod.metadata.name.unwrap(), pod);
    }

    Ok(())
}

There is a kubernetes configuration file at ~/.kube/config.

When reaching api.list the following error message is printed to terminal, and program crashes:

Error: HyperError(hyper::Error(Connect, Custom { kind: Other, error: "invalid dnsname" }))

My Cargo.toml follows the example:

[dependencies]
serde_json = "1.0.59"
serde = {version = "1.0", features = ["derive"]}

tokio = {version = "1.5.0", features = ["macros", "time", "rt-multi-thread"]}
futures = { version = "0.3", default-features = false }

kube = { version = "0.58.1", default-features = false, features = ["client", "rustls-tls"] }
kube-runtime = { version = "0.58.1" }
k8s-openapi = { version = "0.12.0", default-features = false, features = ["v1_20"] }
`` 

Any idea?
@clux
Copy link
Member

clux commented Jul 21, 2021

Just with a quick scan of the rustls-tls feature leads me to believe this is due to #587

@clux clux added the client http issues with the client label Jul 21, 2021
@clux
Copy link
Member

clux commented Jul 21, 2021

Sorry, I meant #153

That said, the former issue might be a way to work around it.

@clux
Copy link
Member

clux commented Jul 21, 2021

Closing as a duplicate of #153 (same error message). But if you would like to test a potential fix, you could try the branch at #597 (or switch back to openssl, because this is a rustls limitation atm).

@clux clux closed this as completed Jul 21, 2021
@clux
Copy link
Member

clux commented Jul 21, 2021

Closing as a duplicate of #153 (same error message). But if you would like to test a potential fix, you could try the branch at #597 (or switch back to openssl, because this is a rustls limitation atm).

@clux clux added rustls rustls-tls related duplicate This issue or pull request already exists labels Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client http issues with the client duplicate This issue or pull request already exists rustls rustls-tls related
Projects
None yet
Development

No branches or pull requests

2 participants