Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unresolved import kube::api::AttachParams no AttachParams in api #1159

Closed
shenshouer opened this issue Mar 6, 2023 · 4 comments
Closed

unresolved import kube::api::AttachParams no AttachParams in api #1159

shenshouer opened this issue Mar 6, 2023 · 4 comments
Labels
question Direction unclear; possibly a bug, possibly could be improved.

Comments

@shenshouer
Copy link

Current and expected behavior

Current behavior:
When I run the example pod_shell.rs https://github.com/kube-rs/kube/blob/main/examples/pod_shell.rs, compile error: unresolved import kube::api::AttachParams no AttachParams in api

The Cargo.toml:

[package]
name = "example-ssh"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = "1.0.69"
async-trait = "0.1.64"
dotenv = "0.15.0"
env_logger = "0.10.0"
futures = "0.3.26"
ldap3 = "0.11.1"
russh = "0.36.1"
russh-keys = "0.24.1"
tokio = { version = "1.26.0", features = ["full"]}
kube = { version = "0.80.0", features = ["client", "runtime", "derive"] }
k8s-openapi = { version = "0.17.0", features = ["v1_26"] }
tracing = "0.1.37"
serde_json = "1.0.93"
tracing-subscriber = "0.3.16"
serde = { version = "1.0.152", features = ["derive"] }

Possible solution

No response

Additional context

No response

Environment

% kubectl version --short
Flag --short has been deprecated, and will be removed in the future. The --short output will become the default.
Client Version: v1.25.4
Kustomize Version: v4.5.7
Server Version: v1.25.4

Configuration and features

No response

Affected crates

No response

Would you like to work on fixing this bug?

None

@shenshouer shenshouer added the bug Something isn't working label Mar 6, 2023
@clux
Copy link
Member

clux commented Mar 6, 2023

The example works in main using just cargo run --example pod_shell.

It looks like your toml is missing the ws feature from kube.

@clux clux added question Direction unclear; possibly a bug, possibly could be improved. and removed bug Something isn't working labels Mar 6, 2023
@shenshouer
Copy link
Author

shenshouer commented Mar 6, 2023

Yes, If i add feature ws, it compiled ok.

kube = { version = "0.80.0", features = ["client", "runtime", "derive", "ws"] }

@frapa
Copy link

frapa commented Jul 4, 2023

I stumbled on the same error. The cause for this is that the API docs list it as requiring client not ws.

@clux
Copy link
Member

clux commented Jul 4, 2023

Thanks for the heads up. This is a documentation issue on our end. Have raised this separately in #1242

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Direction unclear; possibly a bug, possibly could be improved.
Projects
None yet
Development

No branches or pull requests

3 participants