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

[Feature Request] Support overriding the accept_invalid_certs option of kube_client::Client #152

Open
suraciii opened this issue Apr 23, 2023 · 0 comments

Comments

@suraciii
Copy link

Currently, Kubert only supports skipping certificate checks for clients configured by kubeconfig (the default behavior of kube-rs/kube).

Does it sound like a good idea to provide a switch to skip certificate checks for all clients, including in-cluster clients?

like this:

pub struct ClientArgs {
    // ...
    /// Whether to accept invalid certificates
    #[cfg_attr(feature = "clap", clap(long = "insecure"))]
    pub accept_invalid_certs: Option<bool>,
}
// ...
impl ClientArgs {
    pub async fn try_client(self) -> Result<Client, ConfigError> {
      let **mut** client = match self.load_local_config().await {
            Ok(client) => client,
            Err(e) if self.is_customized() => return Err(e),
            Err(_) => Config::incluster()?,
        };

        **client.accept_invalid_certs = self.accept_invalid_certs.unwrap_or_default();**
        client.try_into().map_err(Into::into)
    }
// ...
}
@suraciii suraciii changed the title [Feature Request] Support to skip cert check for incluster client [Feature Request] Support overriding the accept_invalid_certs option of kube_client::Client Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant