Skip to content

Re-export deprecated type alias and improve deprecation guidance#1883

Merged
clux merged 10 commits into
mainfrom
err-resp-depr
Jan 3, 2026
Merged

Re-export deprecated type alias and improve deprecation guidance#1883
clux merged 10 commits into
mainfrom
err-resp-depr

Conversation

@clux
Copy link
Copy Markdown
Member

@clux clux commented Jan 3, 2026

Follow-up to #1875 to make the breaking change less jarring for people using the type from this re-export. It also updates the deprecation warning to guide people to the new pattern.


Before (using the deprecated ErrorResponse from kube::error); fails and no deprecation;

error[E0422]: cannot find struct, variant or union type `ErrorResponse` in module `kube::error`
   --> src/controller/reconcile.rs:129:39
    |
129 |         kube::Error::Api(kube::error::ErrorResponse { code: 403, .. }) => {
    |                                       ^^^^^^^^^^^^^ not found in `kube::error`

For more information about this error, try `rustc --explain E0422`.
error: could not compile `xctrl` (lib) due to 1 previous error

After

warning: use of deprecated type alias `kube::kube_core::ErrorResponse`: use kube::core::Status instead.

         Note that the Error::Api constructor based pattern matches have been helper functions due to boxing.
           See Status docs for the new pattern:
           https://docs.rs/kube/latest/kube/core/struct.Status.html
   --> src/controller/reconcile.rs:129:39
    |
129 |         kube::Error::Api(kube::error::ErrorResponse { code: 403, .. }) => {
    |                                       ^^^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

error[E0308]: mismatched types
   --> src/controller/reconcile.rs:129:26
    |
128 |     .map_err(|error| match error {
    |                            ----- this expression has type `kube::Error`
129 |         kube::Error::Api(kube::error::ErrorResponse { code: 403, .. }) => {
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<Status>`, found `Status`
    |
    = note: expected struct `Box<kube::kube_core::Status>`
               found struct `kube::kube_core::Status`

so hopefully people look at the warning

@clux clux added the changelog-fix changelog fix category for prs label Jan 3, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.1%. Comparing base (5d9aa40) to head (7ea64e5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1883     +/-   ##
=======================================
+ Coverage   76.0%   76.1%   +0.1%     
=======================================
  Files         85      85             
  Lines       8285    8285             
=======================================
+ Hits        6295    6298      +3     
+ Misses      1990    1987      -3     
Files with missing lines Coverage Δ
kube-client/src/client/mod.rs 76.5% <ø> (ø)
kube-core/src/response.rs 64.0% <ø> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@clux clux marked this pull request as ready for review January 3, 2026 05:11
@clux
Copy link
Copy Markdown
Member Author

clux commented Jan 3, 2026

@imp small update to #1875 here for your consideration.

@clux clux added this to the 3.0.0 milestone Jan 3, 2026
@clux clux changed the title Re-export deprecated type alias temporarily Re-export deprecated type alias and improve deprecation guidance Jan 3, 2026
@imp
Copy link
Copy Markdown
Contributor

imp commented Jan 3, 2026

This is great!

@clux clux merged commit 5ad6c18 into main Jan 3, 2026
17 checks passed
@clux clux deleted the err-resp-depr branch January 3, 2026 10:12
@clux clux mentioned this pull request Jan 6, 2026
hugoponthieu pushed a commit to hugoponthieu/kube that referenced this pull request Jan 29, 2026
…e-rs#1883)

* Re-export deprecated type alias temporarily

Signed-off-by: clux <[email protected]>

* some extra docs

Signed-off-by: clux <[email protected]>

* newlines?

Signed-off-by: clux <[email protected]>

* may as well put a link in there

Signed-off-by: clux <[email protected]>

* use the opportunity to not have duplicate exports everywhere

Signed-off-by: clux <[email protected]>

* actually need this one re-export

Signed-off-by: clux <[email protected]>

* clarify further since the box error may still lead people to try to box/deref

Signed-off-by: clux <[email protected]>

* trailing newline stripped anyway..

Signed-off-by: clux <[email protected]>

* fmt more

Signed-off-by: clux <[email protected]>

---------

Signed-off-by: clux <[email protected]>
cchndl pushed a commit to cchndl/kube that referenced this pull request Feb 19, 2026
…e-rs#1883)

* Re-export deprecated type alias temporarily

Signed-off-by: clux <[email protected]>

* some extra docs

Signed-off-by: clux <[email protected]>

* newlines?

Signed-off-by: clux <[email protected]>

* may as well put a link in there

Signed-off-by: clux <[email protected]>

* use the opportunity to not have duplicate exports everywhere

Signed-off-by: clux <[email protected]>

* actually need this one re-export

Signed-off-by: clux <[email protected]>

* clarify further since the box error may still lead people to try to box/deref

Signed-off-by: clux <[email protected]>

* trailing newline stripped anyway..

Signed-off-by: clux <[email protected]>

* fmt more

Signed-off-by: clux <[email protected]>

---------

Signed-off-by: clux <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-fix changelog fix category for prs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants