From 333f9f90119702106a4b0cfef2160e1e562f423e Mon Sep 17 00:00:00 2001 From: Eirik A Date: Sun, 20 Jun 2021 00:08:05 +0100 Subject: [PATCH] remove language-unusual trait conjugation for subresources - fixes #536 (#560) --- kube/src/api/mod.rs | 4 ++-- kube/src/api/subresource.rs | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/kube/src/api/mod.rs b/kube/src/api/mod.rs index 385d73c2a..029cf1de4 100644 --- a/kube/src/api/mod.rs +++ b/kube/src/api/mod.rs @@ -8,8 +8,8 @@ mod core_methods; mod subresource; #[cfg(feature = "ws")] #[cfg_attr(docsrs, doc(cfg(feature = "ws")))] -pub use subresource::{AttachParams, Attachable, Executable}; -pub use subresource::{EvictParams, Evictable, LogParams, Loggable, ScaleSpec, ScaleStatus}; +pub use subresource::{AttachParams, Attach, Execute}; +pub use subresource::{EvictParams, Evict, LogParams, Log, ScaleSpec, ScaleStatus}; // Re-exports from kube-core #[cfg(feature = "admission")] diff --git a/kube/src/api/subresource.rs b/kube/src/api/subresource.rs index c7b512979..1067eec35 100644 --- a/kube/src/api/subresource.rs +++ b/kube/src/api/subresource.rs @@ -147,13 +147,13 @@ fn log_path() { } /// Marker trait for objects that has logs -pub trait Loggable {} +pub trait Log {} -impl Loggable for k8s_openapi::api::core::v1::Pod {} +impl Log for k8s_openapi::api::core::v1::Pod {} impl Api where - K: DeserializeOwned + Loggable, + K: DeserializeOwned + Log, { /// Fetch logs as a string pub async fn logs(&self, name: &str, lp: &LogParams) -> Result { @@ -185,13 +185,13 @@ fn evict_path() { } /// Marker trait for objects that can be evicted -pub trait Evictable {} +pub trait Evict {} -impl Evictable for k8s_openapi::api::core::v1::Pod {} +impl Evict for k8s_openapi::api::core::v1::Pod {} impl Api where - K: DeserializeOwned + Evictable, + K: DeserializeOwned + Evict, { /// Create an eviction pub async fn evict(&self, name: &str, ep: &EvictParams) -> Result { @@ -225,17 +225,17 @@ fn attach_path() { /// Marker trait for objects that has attach #[cfg(feature = "ws")] #[cfg_attr(docsrs, doc(cfg(feature = "ws")))] -pub trait Attachable {} +pub trait Attach {} #[cfg(feature = "ws")] #[cfg_attr(docsrs, doc(cfg(feature = "ws")))] -impl Attachable for k8s_openapi::api::core::v1::Pod {} +impl Attach for k8s_openapi::api::core::v1::Pod {} #[cfg(feature = "ws")] #[cfg_attr(docsrs, doc(cfg(feature = "ws")))] impl Api where - K: Clone + DeserializeOwned + Attachable, + K: Clone + DeserializeOwned + Attach, { /// Attach to pod pub async fn attach(&self, name: &str, ap: &AttachParams) -> Result { @@ -271,17 +271,17 @@ fn exec_path() { /// Marker trait for objects that has exec #[cfg(feature = "ws")] #[cfg_attr(docsrs, doc(cfg(feature = "ws")))] -pub trait Executable {} +pub trait Execute {} #[cfg(feature = "ws")] #[cfg_attr(docsrs, doc(cfg(feature = "ws")))] -impl Executable for k8s_openapi::api::core::v1::Pod {} +impl Execute for k8s_openapi::api::core::v1::Pod {} #[cfg(feature = "ws")] #[cfg_attr(docsrs, doc(cfg(feature = "ws")))] impl Api where - K: Clone + DeserializeOwned + Executable, + K: Clone + DeserializeOwned + Execute, { /// Execute a command in a pod pub async fn exec(