Skip to content

0.64.0

Compare
Choose a tag to compare
@github-actions github-actions released this 16 Nov 21:17
· 674 commits to main since this release
  • BREAKING: Replaced feature kube-derive/schema with attribute #[kube(schema)] - #690
    • If you currently disable default kube-derive default features to avoid automatic schema generation, add #[kube(schema = "disabled")] to your spec struct instead
  • BREAKING: Moved CustomResource derive crate overrides into subattribute #[kube(crates(...))] - #690
    • Replace #[kube(kube_core = .., k8s_openapi = .., schema = .., serde = .., serde_json = ..)] with #[kube(crates(kube_core = .., k8s_openapi = .., schema = .., serde = .., serde_json = ..))]
  • Added openssl-tls feature to use openssl for TLS on all platforms. Note that, even though native-tls uses a platform specific TLS, kube requires openssl on all platforms because native-tls only allows PKCS12 input to load certificates and private key at the moment, and creating PKCS12 requires openssl. - #700
  • BREAKING: Changed to fail loading configurations with PEM-encoded certificates containing invalid sections instead of ignoring them. Updated pem to 1.0.1. - #702
  • oauth: Updated tame-oauth to 0.6.0 which supports the same default credentials flow as the Go oauth2 for Google OAuth. In addition to reading the service account information from JSON file specified with GOOGLE_APPLICATION_CREDENTIALS environment variable, Application Default Credentials from gcloud, and obtaining OAuth tokens from local metadata server when running inside GCP are now supported. - #701

Refining Errors

We started working on improving error ergonomics. See the tracking issue #688 for more details.

The following is the summary of changes to kube::Error included in this release:

  • Added Error::Auth(kube::client::AuthError) (errors related to client auth, some of them were previously in Error::Kubeconfig)
  • Added Error::BuildRequest(kube::core::request::Error) (errors building request from kube::core)
  • Added Error::InferConfig(kube::config::InferConfigError) (for Client::try_default)
  • Added Error::OpensslTls(kube::client::OpensslTlsError) (new openssl-tls feature) - #700
  • Added Error::UpgradeConnection(kube::client::UpgradeConnectinError) (ws feature, errors from upgrading a connection)
  • Removed Error::Connection (was unused)
  • Removed Error::RequestBuild (was unused)
  • Removed Error::RequestSend (was unused)
  • Removed Error::RequestParse (was unused)
  • Removed Error::InvalidUri (replaced by variants of errors in kube::config errors)
  • Removed Error::RequestValidation (replaced by a variant of Error::BuildRequest)
  • Removed Error::Kubeconfig (replaced by Error::InferConfig, and Error::Auth)
  • Removed Error::ProtocolSwitch (ws only, replaced by Error::UpgradeConnection)
  • Removed Error::MissingUpgradeWebSocketHeader (ws only, replaced by Error::UpgradeConnection)
  • Removed Error::MissingConnectionUpgradeHeader (ws only, replaced by Error::UpgradeConnection)
  • Removed Error::SecWebSocketAcceptKeyMismatch (ws only, replaced by Error::UpgradeConnection)
  • Removed Error::SecWebSocketProtocolMismatch (ws only, replaced by Error::UpgradeConnection)
  • Removed impl From<T> for Error
Expand for more details

The following breaking changes were made as a part of an effort to refine errors (the list is large, but most of them are lower level, and shouldn't require much change in most cases):

  • Removed impl From<E> for kube::Error - #686
  • Removed unused error variants in kube::Error: Connection, RequestBuild, RequestSend, RequestParse - #689
  • Removed unused error variant kube::error::ConfigError::LoadConfigFile - #689
  • Changed kube::Error::RequestValidation(String) to kube::Error::BuildRequest(kube::core::request::Error). Includes possible errors from building an HTTP request, and contains some errors from kube::core that was previously grouped under kube::Error::SerdeError and kube::Error::HttpError. kube::core::request::Error is described below. - #686
  • Removed kube::core::Error and kube::core::Result. kube::core::Error was replaced by more specific errors. - #686
    • Replaced kube::core::Error::InvalidGroupVersion with kube::core::gvk::ParseGroupVersionError
    • Changed the error returned from kube::core::admission::AdmissionRequest::with_patch to kube::core::admission::SerializePatchError (was kube::core::Error::SerdeError)
    • Changed the error associated with TryInto<AdmissionRequest<T>> to kube::core::admission::ConvertAdmissionReviewError (was kube::core::Error::RequestValidation)
    • Changed the error returned from methods of kube::core::Request to kube::core::request::Error (was kube::core::Error). kube::core::request::Error represents possible errors when building an HTTP request. The removed kube::core::Error had RequestValidation(String), SerdeError(serde_json::Error), and HttpError(http::Error) variants. They are now Validation(String), SerializeBody(serde_json::Error), and BuildRequest(http::Error) respectively in kube::core::request::Error.
  • Changed variants of error enums in kube::runtime to tuples. Replaced snafu with thiserror. - #686
  • Removed kube::error::ConfigError and kube::Error::Kubeconfig(ConfigError) - #696
    • Error variants related to client auth were moved to a new error kube::client::AuthError as described below
    • Remaining variants were split into kube::config::{InferConfigError, InClusterError, KubeconfigError} as described below
  • Added kube::client::AuthError by extracting error variants related to client auth from kube::ConfigError and adding more variants to preserve context - #696
  • Moved kube::error::OAuthError to kube::client::OAuthError - #696
  • Changed all errors in kube::client::auth to kube::client::AuthError - #696
  • Added kube::Error::Auth(kube::client::AuthError) - #696
  • Added kube::config::InferConfigError which is an error from Config::infer() and kube::Error::InferConfig(kube::config::InferConfigError) - #696
  • Added kube::config::InClusterError for errors related to loading in-cluster configuration by splitting kube::ConfigError and adding more variants to preserve context. - #696
  • Added kube::config::KubeconfigError for errors related to loading kubeconfig by splitting kube::ConfigError and adding more variants to preserve context. - #696
  • Changed methods of kube::Config to return these erorrs instead of kube::Error - #696
  • Removed kube::Error::InvalidUri which was replaced by error variants preserving context, such as KubeconfigError::ParseProxyUrl - #696
  • Moved all errors from upgrading to a WebSocket connection into kube::Error::UpgradeConnection(kube::client::UpgradeConnectionError) - #696