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