deps: update rust crate kube to v4 - #22
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
renovate
Bot
force-pushed
the
renovate/kube-4.x
branch
from
July 25, 2026 04:13
294f635 to
3d8aebb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.69→4.0Release Notes
kube-rs/kube (kube)
v4.2.0Compare Source
===================
v4.0.0Compare Source
===================
New Major
As per the release schedule to match up with the latest Kubernetes ハル release.
Lots of fixes and improvements. Thanks to everyone who contributed!
Kubernetes
v1_36support via k8s-openapi 0.28Please upgrade k8s-openapi along with kube to avoid conflicts.
CEL Validation
A new optional crate kube-cel is being re-exported through
kube::core::celvia #1954Kubernetes CRDs support CEL validation rules via
x-kubernetes-validations, and were supported from 3.0 viaKubeSchema, but these rules could only be evaluated server-side by the API server.The new crate allows evaluating these rules locally using rules matching the upstream Kubernetes CEL libraries.
While low-level, a higher-level CEL validator integrates with
CustomResourcevia#[kube(cel)]from #2011 and can be used as;See examples/crd_derive_cel.rs for more details.
This is available under the
kube/celfeature, courtesy of @doxxx93.Config
A lot of improvements to config handling;
Kubeconfigfields in #1965Kubeconfigfuture key compatibility for new fields by adding catch-allotherkey via #1964serde-yamltoserde-saphyrto get rid of the long-deprecated dependency. #1975Retry and Timeouts
Better timeout and retry handling to better deal with flaky network conditions, and busy or initializing apiservers.
watcherlevel timeouts in #1945 (see #1798 for context)RetryPolicy- now enabled by default in #2007.Client
tls-server-namewithopenssl-tlsvia #1993yamloutput fromexecplugins via #2003wstask leak anddrop, and a deadlock onjoin()via #1978Runtime
watcherautomatically uses themetadata_api methods when called withPartialObjectMeta<K>via #1952metadata_watcherin favor of an explicit change fromApi::<K>toApi::<PartialObjectMeta<K>>)wait::conditions::is_createdas a counter tois_deleted#2000Store::state_filteredandStore::state_filter_selectorto allow more efficient slicing of the locked cache via #2002 + #1998What's Changed
Added
AdmissionRequest::to_cel_request()for VAP CEL bridging by @doxxx93 in #1991Store::state_withandStore::state_filteredby @Alvov1 in #1998wait::conditions::is_createdhelper by @orangecms in #2000RetryPolicy::server_retryby default forClientby @Danil-Grigorev in #2007Changed
Fixed
fix: feature-flag CREATE_NO_WINDOW to not break stderr inheritance by @cristeigabriela in #1971
Remove silent error when client-key/client-certificate is malformed by @goenning in #1966
Fix AttachedProcess task leak on drop and join() deadlock by @SebTardif in #1978
support auth exec yaml output by @aviramha in #2003
fix(client): apply tls-server-name on the openssl-tls path by @dgunzy in #1993
Use the resource's own name for the schema title by @cehoffman in #1985
@alex-lapuka made their first contribution in #1965
@cristeigabriela made their first contribution in #1971
@mattklein123 made their first contribution in #1972
@chrnorm made their first contribution in #1962
@SebTardif made their first contribution in #1978
@Alvov1 made their first contribution in #1998
@orangecms made their first contribution in #2000
@dgunzy made their first contribution in #1993
@cehoffman made their first contribution in #1985
Full Changelog: kube-rs/kube@3.1.0...4.0.0
v3.1.0Compare Source
===================
New Major
As per the release schedule to match up with the latest Kubernetes ハル release.
Lots of fixes and improvements. Thanks to everyone who contributed!
Kubernetes
v1_36support via k8s-openapi 0.28Please upgrade k8s-openapi along with kube to avoid conflicts.
CEL Validation
A new optional crate kube-cel is being re-exported through
kube::core::celvia #1954Kubernetes CRDs support CEL validation rules via
x-kubernetes-validations, and were supported from 3.0 viaKubeSchema, but these rules could only be evaluated server-side by the API server.The new crate allows evaluating these rules locally using rules matching the upstream Kubernetes CEL libraries.
While low-level, a higher-level CEL validator integrates with
CustomResourcevia#[kube(cel)]from #2011 and can be used as;See examples/crd_derive_cel.rs for more details.
This is available under the
kube/celfeature, courtesy of @doxxx93.Config
A lot of improvements to config handling;
Kubeconfigfields in #1965Kubeconfigfuture key compatibility for new fields by adding catch-allotherkey via #1964serde-yamltoserde-saphyrto get rid of the long-deprecated dependency. #1975Retry and Timeouts
Better timeout and retry handling to better deal with flaky network conditions, and busy or initializing apiservers.
watcherlevel timeouts in #1945 (see #1798 for context)RetryPolicy- now enabled by default in #2007.Client
tls-server-namewithopenssl-tlsvia #1993yamloutput fromexecplugins via #2003wstask leak anddrop, and a deadlock onjoin()via #1978Runtime
watcherautomatically uses themetadata_api methods when called withPartialObjectMeta<K>via #1952metadata_watcherin favor of an explicit change fromApi::<K>toApi::<PartialObjectMeta<K>>)wait::conditions::is_createdas a counter tois_deleted#2000Store::state_filteredandStore::state_filter_selectorto allow more efficient slicing of the locked cache via #2002 + #1998What's Changed
Added
AdmissionRequest::to_cel_request()for VAP CEL bridging by @doxxx93 in #1991Store::state_withandStore::state_filteredby @Alvov1 in #1998wait::conditions::is_createdhelper by @orangecms in #2000RetryPolicy::server_retryby default forClientby @Danil-Grigorev in #2007Changed
Fixed
fix: feature-flag CREATE_NO_WINDOW to not break stderr inheritance by @cristeigabriela in #1971
Remove silent error when client-key/client-certificate is malformed by @goenning in #1966
Fix AttachedProcess task leak on drop and join() deadlock by @SebTardif in #1978
support auth exec yaml output by @aviramha in #2003
fix(client): apply tls-server-name on the openssl-tls path by @dgunzy in #1993
Use the resource's own name for the schema title by @cehoffman in #1985
@alex-lapuka made their first contribution in #1965
@cristeigabriela made their first contribution in #1971
@mattklein123 made their first contribution in #1972
@chrnorm made their first contribution in #1962
@SebTardif made their first contribution in #1978
@Alvov1 made their first contribution in #1998
@orangecms made their first contribution in #2000
@dgunzy made their first contribution in #1993
@cehoffman made their first contribution in #1985
Full Changelog: kube-rs/kube@3.1.0...4.0.0
v3.0.1Compare Source
===================
What's Changed
Maintenance release with fixes for schemas/validation, client exec blocking and proxy handling, as well as some smaller new features listed below. Internal changes and documentation improvements listed in the milestone.
Added
Ruleby @Immortal-Beyond-Oblivion in #1947Fixed
Fix OptionalEnum transform for complex enums by @doxxx93 in #1934
Bump tower-http dependency to 0.6.4 by @abustany in #1939
Add minimal-versions CI check by @doxxx93 in #1940
fix: Produce valid CRDs containing flattened untagged enums by @NickLarsenNZ in #1942
kube-client: Avoid blocking tokio worker during exec auth token refresh by @blakelawson in #1950
@abustany made their first contribution in #1939
@cchndl made their first contribution in #1872
@Immortal-Beyond-Oblivion made their first contribution in #1947
@gauravgahlot made their first contribution in #1949
@blakelawson made their first contribution in #1950
Full Changelog: kube-rs/kube@3.0.1...3.1.0
v3.0.0Compare Source
===================
New Major
As per the new release schedule to match up with the new Kubernetes release.
Lots of additions, fixes and improvements. Thanks to everyone who contributed so heavily over the holidays! Happy new year.
Breaking Changes
Kubernetes
v1_35support via k8s-openapi 0.27Please upgrade k8s-openapi along with kube to avoid conflicts.
jiffreplaceschronoMatching k8s-openapi's change, kube has also swapped out
chrono. The biggest impact of this is for interacting with timestamps inmetadata, but it also updates 2 smaller public interfaces inLogParams,Client::with_valid_until. See controller-rs#217 for an example change.Changes: #1868 + #1870
ErrorResponsehas been replaced withStatusErrorResponseserved as a partial metav1/Status replacement which ended up hiding error information to users. These structs have merged, more information is available on errors, and a type alias with a deprecation warning is in place forErrorResponsewhich will be removed in a later version.This creates a small breaking change for users matching on specific
Error::Apicodes;.map_err(|error| match error { - kube::Error::Api(kube::error::ErrorResponse { code: 403, .. }) => { - Error::UnauthorizedToPatch(obj) - } + kube::Error::Api(s) if s.is_forbidden() => Error::UnauthorizedToPatch(obj), other => Error::Other(other), })?;#1875 + #1883 + #1891.
Predicates now has a TTL Cache
This prevents unbounded memory for controllers, particularly affecting ones watching quickly rotating objects with generated names (e.g. pods). By default the TTL is
1h. It can be configured via newPredicateConfigparameter. To use the default;Change in #1836. This helped expose and fix a bug in watches with streaming_lists now fixed in #1882.
Subresource Api
Some subresource write methods were public with inconsistent signatures that required less ergonomic use than any other write methods. They took a
Vec<u8>for the post body, now they take a&K: Serializeor the actual subresource.There affect
Api::create_subresource,Api::replace_subresource,Api::replace_status,Api::replace_scale. In essence this generally means you do not have to wrap raw objects injson!andserde_json::to_vecfor these calls and lean more on rust's typed objects rather thanjson!blobs which has some footguns for subresources.See some more shifts in examples in the implementation; #1884
Improvements
Support Kubernetes 1.30 Aggregated Discovery
Speeds up api discovery significantly by using the newer api with much less round-tripping.
To opt-in change
Discovery::run()toDiscovery::run_aggregated()Changes; #1876 + #1873 + #1889
Rust 2024
While this is mostly for internal ergonomics, we would like to highlight this also simplifies the
Conditionimplementors which had to deal with a lot of options;pub fn is_job_completed() -> impl Condition<Job> { |obj: Option<&Job>| { - if let Some(job) = &obj { - if let Some(s) = &job.status { - if let Some(conds) = &s.conditions { - if let Some(pcond) = conds.iter().find(|c| c.type_ == "Complete") { - return pcond.status == "True"; - } - } - } + if let Some(job) = &obj + && let Some(s) = &job.status + && let Some(conds) = &s.conditions + && let Some(pcond) = conds.iter().find(|c| c.type_ == "Complete") + { + return pcond.status == "True";Change #1856 + #1792
New Client
RetryPolicyopt-inAllows custom clients (for now) to enable exponential backoff'd retries for retryable errors by exposing a
tower::retry::Policyfor atower::retry::Layer. See the new custom_client_retry example for details.Enabled by a cloneable body + the new RetryPolicy based on mirrord's solution*.
Fixes
More
Resizesubresource impl forPod- #1851#[kube(attr="...")to allow custom attrs on derives - #1850What's Changed
Added
Resizesubresource forPodby @hugoponthieu in #1851try_clonemethod forkube_client::client::Bodywhen it'sKind::Onceby @meowjesty in #1867Changed
predicate_filterby @doxxx93 in #1838chronowithjiffby @ngergs in #1868k8s-openapifor Kubernetes 1.35 by @clux in #1898Fixed
v2.0.1Compare Source
===================
What's Changed
Fixes an accidental inclusion of a constraint added to
Api::log_streamintroduced in the 2.0.0 Rust 2024 upgrade.Fixed
v2.0.0Compare Source
===================
New Major
As per the new release schedule to match up with the new Kubernetes release.
Lots of additions, fixes and improvements. Thanks to everyone who contributed so heavily over the holidays! Happy new year.
Breaking Changes
Kubernetes
v1_35support via k8s-openapi 0.27Please upgrade k8s-openapi along with kube to avoid conflicts.
jiffreplaceschronoMatching k8s-openapi's change, kube has also swapped out
chrono. The biggest impact of this is for interacting with timestamps inmetadata, but it also updates 2 smaller public interfaces inLogParams,Client::with_valid_until. See controller-rs#217 for an example change.Changes: #1868 + #1870
ErrorResponsehas been replaced withStatusErrorResponseserved as a partial metav1/Status replacement which ended up hiding error information to users. These structs have merged, more information is available on errors, and a type alias with a deprecation warning is in place forErrorResponsewhich will be removed in a later version.This creates a small breaking change for users matching on specific
Error::Apicodes;.map_err(|error| match error { - kube::Error::Api(kube::error::ErrorResponse { code: 403, .. }) => { - Error::UnauthorizedToPatch(obj) - } + kube::Error::Api(s) if s.is_forbidden() => Error::UnauthorizedToPatch(obj), other => Error::Other(other), })?;#1875 + #1883 + #1891.
Predicates now has a TTL Cache
This prevents unbounded memory for controllers, particularly affecting ones watching quickly rotating objects with generated names (e.g. pods). By default the TTL is
1h. It can be configured via newPredicateConfigparameter. To use the default;Change in #1836. This helped expose and fix a bug in watches with streaming_lists now fixed in #1882.
Subresource Api
Some subresource write methods were public with inconsistent signatures that required less ergonomic use than any other write methods. They took a
Vec<u8>for the post body, now they take a&K: Serializeor the actual subresource.There affect
Api::create_subresource,Api::replace_subresource,Api::replace_status,Api::replace_scale. In essence this generally means you do not have to wrap raw objects injson!andserde_json::to_vecfor these calls and lean more on rust's typed objects rather thanjson!blobs which has some footguns for subresources.See some more shifts in examples in the implementation; #1884
Improvements
Support Kubernetes 1.30 Aggregated Discovery
Speeds up api discovery significantly by using the newer api with much less round-tripping.
To opt-in change
Discovery::run()toDiscovery::run_aggregated()Changes; #1876 + #1873 + #1889
Rust 2024
While this is mostly for internal ergonomics, we would like to highlight this also simplifies the
Conditionimplementors which had to deal with a lot of options;pub fn is_job_completed() -> impl Condition<Job> { |obj: Option<&Job>| { - if let Some(job) = &obj { - if let Some(s) = &job.status { - if let Some(conds) = &s.conditions { - if let Some(pcond) = conds.iter().find(|c| c.type_ == "Complete") { - return pcond.status == "True"; - } - } - } + if let Some(job) = &obj + && let Some(s) = &job.status + && let Some(conds) = &s.conditions + && let Some(pcond) = conds.iter().find(|c| c.type_ == "Complete") + { + return pcond.status == "True";Change #1856 + #1792
New Client
RetryPolicyopt-inAllows custom clients (for now) to enable exponential backoff'd retries for retryable errors by exposing a
tower::retry::Policyfor atower::retry::Layer. See the new custom_client_retry example for details.Enabled by a cloneable body + the new RetryPolicy based on mirrord's solution*.
Fixes
More
Resizesubresource impl forPod- #1851#[kube(attr="...")to allow custom attrs on derives - #1850What's Changed
Added
Resizesubresource forPodby @hugoponthieu in #1851try_clonemethod forkube_client::client::Bodywhen it'sKind::Onceby @meowjesty in #1867Changed
predicate_filterby @doxxx93 in #1838chronowithjiffby @ngergs in #1868k8s-openapifor Kubernetes 1.35 by @clux in #1898Fixed
v1.1.0Compare Source
===================
What's Changed
Missing attribute bugfix + extra standard derives on core::conversion structs.
Added
Fixed
#[schemars(crate)]attribute by @Techassi in #1764v1.0.0Compare Source
A Major Version
It's been a long time coming, but time has come to draw the line in the sand. No alphas, no betas. Hope it finds you all well. Thanks to everyone who has contributed over the years.
This is a somewhat symbolic gesture, because semver-breaking changes are still hard to avoid with a large set of sub-1.0 dependencies we need to bump, as well as managing the large api surface of Kubernetes.
Therefore, the plan is to align our breaking changes and major bumps with Kubernetes versions / k8s-openapi versions for now, and this should allow our other releases to stream in. See #1688 for more information.
Kubernetes
v1_33support viak8s-openapi0.25Please upgrade k8s-openapi along with kube to avoid conflicts.
New minimum versions: MSRV 1.82.0, MK8SV: 1.30*
KubeSchema
The
CELSchemaalternate derive forJsonSchemahas been renamed toKubeSchemato indicate the increased functionality.In addition to being able to inject CEL rules for validations, it can now also inject
x-kubernetesproperties such as merge-strategy via #1750, handle#[validate]attributes #1749, and pass validation rules as string literals #1754 :