Skip to content

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

@suraciii

Description

@suraciii

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)
    }
// ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions