kube-rs / kube

Rust Kubernetes client and controller runtime
https://kube.rs
Apache License 2.0
2.91k stars 304 forks source link

[v0.93] unresolved import `crate::client` #1548

Closed HoKim98 closed 2 months ago

HoKim98 commented 2 months ago

Current and expected behavior

Problem Situation

cargo build --package kube --no-default-features  # no `client` feature

Expected behavior

   Compiling kube v0.93.0 (/home/user/Library/kube/kube)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.12s

Current behavior

error[E0432]: unresolved import `crate::client`
   --> kube/src/lib.rs:197:46
    |
197 |     #[allow(unreachable_pub)] pub use crate::client::ConfigExt as _;
    |                                              ^^^^^^ could not find `client` in the crate root
    |
note: found an item that was configured out
   --> kube/src/lib.rs:140:26
    |
140 |     pub use kube_client::client;
    |                          ^^^^^^
    = note: the item is gated behind the `client` feature

warning: unused import: `crate::client::ConfigExt as _`
   --> kube/src/lib.rs:197:39
    |
197 |     #[allow(unreachable_pub)] pub use crate::client::ConfigExt as _;
    |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_imports)]` on by default

For more information about this error, try `rustc --explain E0432`.
warning: `kube` (lib) generated 1 warning
error: could not compile `kube` (lib) due to 1 previous error; 1 warning emitted

Possible solution

Add #[cfg(feature = "client")] constraint on #[allow(unreachable_pub)] pub use crate::client::ConfigExt as _;

Please see #1549

Additional context

No response

Environment

Configuration and features

kube = { version = "0.93", default-features = false }

Affected crates

No response

Would you like to work on fixing this bug?

yes