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

Rewrite dynamic api example #466

Merged
merged 3 commits into from
Mar 19, 2021
Merged

Conversation

MikailBag
Copy link
Contributor

This example now shows how one can use kube to inspect arbitrary
resources.

This example now shows how one can use kube to inspect arbitrary
resources.
Copy link
Member

@clux clux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nits. appreciate the quick pr!

examples/dynamic_api.rs Show resolved Hide resolved
None => {
println!("\t\t{}", name);
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DynamicObject implements Meta now, right. We can use Meta::name and Meta::namespace here for a one-liner?

}
println!("\t{}", ar.kind);
let api = DynamicResource::from_api_resource(&ar, &apis.group_version)
.into_api::<DynamicObject>(client.clone());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is anything here dealing with namespaces, or is it just cluster / all querying?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are listing objects from all namespaces.

I will add an option to only list resources from one namespace.

@clux clux merged commit f285d6d into kube-rs:master Mar 19, 2021
@clux
Copy link
Member

clux commented Mar 19, 2021

Did a small cleanup to it in master to remove the special casing after we merged #470.
Also tweaked tracing instrumentation a bit because it looked a bit awkward with log (guessing that's why you were using println)

@MikailBag MikailBag deleted the dynamic-api-get-all branch March 20, 2021 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants