Releases: kube-rs/kube
0.66.0
News
Tons of small feature additions, and 3 new contributors in this milestone.
Highlighted first is the 3 most discussed changes:
Support for auto-generating schemas for enums in kube-derive
It is now possible to embed complex enums inside structs that use #[derive(CustomResource)].
This has been a highly requested feature since the inception of auto-generated schemas. It does not work for all cases, and has certain ergonomics caveats, but represents a huge step forwards.
Note that if you depend on kube-derive directly rather than via kube then you must now add the schema feature to kube-core
New StreamBackoff mechanism in kube-runtime
To avoid spamming the apiserver when on certain watch errors cases, it's now possible to stream wrap the watcher to set backoffs. The new default_backoff follows existing client-go conventions of being kind to the apiserver.
Initially, this is default-enabled in Controller watches (configurable via Controller::trigger_backoff) and avoids spam errors when crds are not installed.
New version priority parser in kube-core
To aid users picking the most appropriate version of a kind from api discovery or through a CRD, two new sort orders have been exposed on the new kube_core::Version
Version::priorityimplementing kubernetes version priorityVersion::generationimplementing a more traditional; generational sort (highest version)
What's Changed
Added
- Add
DeleteParamsconstructors for easily settingPropagationPolicyby @kate-goldenring in #757 - Add Serialize to ObjecList and add field-selector and jsonpath example by @ChinYing-Li in #760
- Implement cordon/uncordon for Node by @ChinYing-Li in #762
- Export Version priority parser with Ord impls in kube_core by @clux in #764
- Add Api fns for arbitrary subresources and approval subresource for CertificateSigningRequest by @ChinYing-Li in #773
- Support complex enums in CRDs by @teozkr in #779
Changed
- Add backoff handling for watcher and Controller by @clux in #703
- Remove crate private
identity_pemfield fromConfigby @kazk in #771 - Use SecretString in AuthInfo to avoid credential leaking by @ChinYing-Li in #766
New Contributors
- @kate-goldenring made their first contribution in #757
- @ChinYing-Li made their first contribution in #760
- @LyleScott made their first contribution in #775
Full Changelog: 0.65.0...0.66.0
0.65.0
- BREAKING: Removed
kube::Error::OpenSslError- #716 by @kazk - BREAKING: Removed
kube::Error::SslError- #704 and #716 by @kazk - BREAKING: Added
kube::Error::NativeTls(kube::client::NativeTlsError)for errors from Native TLS - #716 by @kazk - BREAKING: Added
kube::Error::RustlsTls(kube::client::RustlsTlsError)for errors from Rustls TLS - #704 by @kazk - Modified
Kubeconfigparsing - allow empty kubeconfigs as per kubectl - #721 by @kazk - Added
Kubeconfig::from_yaml- #718 via #719 by @imp - Updated
rustlsto 0.20.1 - #704 by @clux and @kazk - BREAKING: Added
ObjectRefto the object that failed to be reconciled tokube::runtime::controller::Error::ReconcileFailed- #733 by @teozkr - BREAKING: Removed
api_versionandkindfields fromkindstructs generated bykube::CustomResource- #739 by @teozkr - Updated
tokio-tungsteniteto 0.16 - #750 by @dependabot - Updated
tower-httpto 0.2.0 - #748 by @kazk - BREAKING:
kube-client: replaceRefreshTokenLayerwithAsyncFilterLayerinAuthLayer- #752 by @kazk
0.64.0
- BREAKING: Replaced feature
kube-derive/schemawith attribute#[kube(schema)]- #690- If you currently disable default
kube-derivedefault features to avoid automatic schema generation, add#[kube(schema = "disabled")]to your spec struct instead
- If you currently disable default
- BREAKING: Moved
CustomResourcederive 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 = ..))]
- Replace
- Added
openssl-tlsfeature to useopensslfor TLS on all platforms. Note that, even thoughnative-tlsuses a platform specific TLS,kuberequiresopensslon all platforms becausenative-tlsonly allows PKCS12 input to load certificates and private key at the moment, and creating PKCS12 requiresopenssl. - #700 - BREAKING: Changed to fail loading configurations with PEM-encoded certificates containing invalid sections instead of ignoring them. Updated
pemto 1.0.1. - #702 oauth: Updatedtame-oauthto 0.6.0 which supports the same default credentials flow as the Gooauth2for Google OAuth. In addition to reading the service account information from JSON file specified withGOOGLE_APPLICATION_CREDENTIALSenvironment variable, Application Default Credentials fromgcloud, 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 inError::Kubeconfig) - Added
Error::BuildRequest(kube::core::request::Error)(errors building request fromkube::core) - Added
Error::InferConfig(kube::config::InferConfigError)(forClient::try_default) - Added
Error::OpensslTls(kube::client::OpensslTlsError)(newopenssl-tlsfeature) - #700 - Added
Error::UpgradeConnection(kube::client::UpgradeConnectinError)(wsfeature, 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 inkube::configerrors) - Removed
Error::RequestValidation(replaced by a variant ofError::BuildRequest) - Removed
Error::Kubeconfig(replaced byError::InferConfig, andError::Auth) - Removed
Error::ProtocolSwitch(wsonly, replaced byError::UpgradeConnection) - Removed
Error::MissingUpgradeWebSocketHeader(wsonly, replaced byError::UpgradeConnection) - Removed
Error::MissingConnectionUpgradeHeader(wsonly, replaced byError::UpgradeConnection) - Removed
Error::SecWebSocketAcceptKeyMismatch(wsonly, replaced byError::UpgradeConnection) - Removed
Error::SecWebSocketProtocolMismatch(wsonly, replaced byError::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)tokube::Error::BuildRequest(kube::core::request::Error). Includes possible errors from building an HTTP request, and contains some errors fromkube::corethat was previously grouped underkube::Error::SerdeErrorandkube::Error::HttpError.kube::core::request::Erroris described below. - #686 - Removed
kube::core::Errorandkube::core::Result.kube::core::Errorwas replaced by more specific errors. - #686- Replaced
kube::core::Error::InvalidGroupVersionwithkube::core::gvk::ParseGroupVersionError - Changed the error returned from
kube::core::admission::AdmissionRequest::with_patchtokube::core::admission::SerializePatchError(waskube::core::Error::SerdeError) - Changed the error associated with
TryInto<AdmissionRequest<T>>tokube::core::admission::ConvertAdmissionReviewError(waskube::core::Error::RequestValidation) - Changed the error returned from methods of
kube::core::Requesttokube::core::request::Error(waskube::core::Error).kube::core::request::Errorrepresents possible errors when building an HTTP request. The removedkube::core::ErrorhadRequestValidation(String),SerdeError(serde_json::Error), andHttpError(http::Error)variants. They are nowValidation(String),SerializeBody(serde_json::Error), andBuildRequest(http::Error)respectively inkube::core::request::Error.
- Replaced
- Changed variants of error enums in
kube::runtimeto tuples. Replacedsnafuwiththiserror. - #686 - Removed
kube::error::ConfigErrorandkube::Error::Kubeconfig(ConfigError)- #696- Error variants related to client auth were moved to a new error
kube::client::AuthErroras described below - Remaining variants were split into
kube::config::{InferConfigError, InClusterError, KubeconfigError}as described below
- Error variants related to client auth were moved to a new error
- Added
kube::client::AuthErrorby extracting error variants related to client auth fromkube::ConfigErrorand adding more variants to preserve context - #696 - Moved
kube::error::OAuthErrortokube::client::OAuthError- #696 - Changed all errors in
kube::client::authtokube::client::AuthError- #696 - Added
kube::Error::Auth(kube::client::AuthError)- #696 - Added
kube::config::InferConfigErrorwhich is an error fromConfig::infer()andkube::Error::InferConfig(kube::config::InferConfigError)- #696 - Added
kube::config::InClusterErrorfor errors related to loading in-cluster configuration by splittingkube::ConfigErrorand adding more variants to preserve context. - #696 - Added
kube::config::KubeconfigErrorfor errors related to loading kubeconfig by splittingkube::ConfigErrorand adding more variants to preserve context. - #696 - Changed methods of
kube::Configto return these erorrs instead ofkube::Error- #696 - Removed
kube::Error::InvalidUriwhich was replaced by error variants preserving context, such asKubeconfigError::ParseProxyUrl- #696 - Moved all errors from upgrading to a WebSocket connection into
kube::Error::UpgradeConnection(kube::client::UpgradeConnectionError)- #696
0.63.2
0.63.1
0.63.0
0.62.0
kubenow re-exportskube-runtimeunderruntimefeature - #651 via #652- no need to keep both
kubeandkube_runtimeinCargo.tomlanymore - fixes issues with dependabot / lock-step upgrading
- change
kube_runtime::Ximport paths tokube::runtime::Xwhen moving to the feature
- no need to keep both
kube::runtimeaddedeventsmodule with an eventRecorder- #249 via #653 + #662 + #663kube::runtime::wait::conditionsaddedis_crd_establishedhelper - #659kube::CustomResourcederive can now take an arbitrary#[kube_core]path forkube::core- #658kube::coreconsistently re-exported across crates- docs: major overhaul + architecture.md - #416 via #652
0.61.0
kube-core: BREAKING: extendCustomResourceExttrait with::shortnamesmethod (impl inkube-derive) - #641kube-runtime: addwaitmodule toawait_condition, and addedwatch_objectto watcher - #632 via #633kube: addRestartmarker trait to allowApi::restarton core workloads - #630 via #635- bump dependencies:
tokio-tungstenite,k8s-openapi,schemars,tokioin particular - #643 + #645
0.60.0
0.59.0
BREAKING: bumpedk8s-openapito 0.13.0 - #581 via #616kubeconnects to kubernetes via cluster dns when usingrustls- #587 via #597kubenicer serialization ofKubeconfig- #613kube-coreadded serde traits forApiResource- #590kube-coreaddedCrdExtensions::crd_namemethod (implemented bykube-derive) - #583kube-coreadded theHasSpecandHasStatustraits - #605kube-deriveadded support to automatically implement theHasSpecandHasStatustraits - #605kube-runtimefix tracing span hierarchy from applier - #600