fix(deps): update rust crate kube to v3 #702
Open
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:
1.0.0→3.0.0Release Notes
kube-rs/kube (kube)
v3.0.1Compare Source
===================
What's Changed
Bugfix release for schemas, admission, and docs. Minor internal improvements listed in the milestone. Important fixes below.
Fixed
AdmissionResponsecreated via invalid call by @Magicloud in #1905OptionalEnumtransform skipping schemas with description by @doxxx93 in #1908additionalProperties: falsefrom schema by @doxxx93 in #1920v3.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 implementaion; #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 clonable 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 implementaion; #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 clonable 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
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.