diff --git a/CHANGELOG.md b/CHANGELOG.md index 59119826a..e11cbe030 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ UNRELEASED =================== * see https://github.com/clux/kube-rs/compare/0.48.0...master + * `kube` subresource support added for `Evictable` types (marked for `Pod`) - #393 + * `kube` subresource marker traits renamed to `Loggable`, `Executable`, `Attachable` (previously `LoggingObject`, `ExecutingObject`, `AttachableObject`) - #395 0.48.0 / 2021-01-23 =================== diff --git a/kube/src/api/mod.rs b/kube/src/api/mod.rs index 06759f84a..6a2fb9fde 100644 --- a/kube/src/api/mod.rs +++ b/kube/src/api/mod.rs @@ -25,8 +25,8 @@ pub use dynamic::DynamicResource; mod subresource; #[cfg(feature = "ws")] -pub use subresource::{AttachParams, AttachableObject, ExecutingObject}; -pub use subresource::{EvictParams, Evictable, LogParams, LoggingObject, ScaleSpec, ScaleStatus}; +pub use subresource::{AttachParams, Attachable, Executable}; +pub use subresource::{EvictParams, Evictable, LogParams, Loggable, ScaleSpec, ScaleStatus}; pub(crate) mod object; pub use self::object::{Object, ObjectList, WatchEvent}; diff --git a/kube/src/api/subresource.rs b/kube/src/api/subresource.rs index 9bb766f46..e7a83c68c 100644 --- a/kube/src/api/subresource.rs +++ b/kube/src/api/subresource.rs @@ -201,13 +201,13 @@ fn log_path() { } /// Marker trait for objects that has logs -pub trait LoggingObject {} +pub trait Loggable {} -impl LoggingObject for k8s_openapi::api::core::v1::Pod {} +impl Loggable for k8s_openapi::api::core::v1::Pod {} impl Api where - K: Clone + DeserializeOwned + LoggingObject, + K: Clone + DeserializeOwned + Loggable, { /// Fetch logs as a string pub async fn logs(&self, name: &str, lp: &LogParams) -> Result { @@ -481,17 +481,17 @@ fn attach_path() { /// Marker trait for objects that has attach #[cfg(feature = "ws")] #[cfg_attr(docsrs, doc(cfg(feature = "ws")))] -pub trait AttachableObject {} +pub trait Attachable {} #[cfg(feature = "ws")] #[cfg_attr(docsrs, doc(cfg(feature = "ws")))] -impl AttachableObject for k8s_openapi::api::core::v1::Pod {} +impl Attachable for k8s_openapi::api::core::v1::Pod {} #[cfg(feature = "ws")] #[cfg_attr(docsrs, doc(cfg(feature = "ws")))] impl Api where - K: Clone + DeserializeOwned + AttachableObject, + K: Clone + DeserializeOwned + Attachable, { /// Attach to pod pub async fn attach(&self, name: &str, ap: &AttachParams) -> Result { @@ -546,17 +546,17 @@ fn exec_path() { /// Marker trait for objects that has exec #[cfg(feature = "ws")] #[cfg_attr(docsrs, doc(cfg(feature = "ws")))] -pub trait ExecutingObject {} +pub trait Executable {} #[cfg(feature = "ws")] #[cfg_attr(docsrs, doc(cfg(feature = "ws")))] -impl ExecutingObject for k8s_openapi::api::core::v1::Pod {} +impl Executable for k8s_openapi::api::core::v1::Pod {} #[cfg(feature = "ws")] #[cfg_attr(docsrs, doc(cfg(feature = "ws")))] impl Api where - K: Clone + DeserializeOwned + ExecutingObject, + K: Clone + DeserializeOwned + Executable, { /// Execute a command in a pod pub async fn exec(&self, name: &str, command: I, ap: &AttachParams) -> Result