Update Rust crate kube to v3 #256
Reference in New Issue
Block a user
Delete Branch "renovate/kube-3.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
2.0.1→3.0.0Release Notes
kube-rs/kube (kube)
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;#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;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: Enabled.
♻ 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 has been generated by Renovate Bot.