diff --git a/kube-client/src/api/mod.rs b/kube-client/src/api/mod.rs index ed07232a8..7872e78b2 100644 --- a/kube-client/src/api/mod.rs +++ b/kube-client/src/api/mod.rs @@ -33,7 +33,7 @@ pub use kube_core::{ watch::WatchEvent, Resource, ResourceExt, }; -use kube_core::{DynamicScope, NamespaceResourceScope}; +use kube_core::{DynamicResourceScope, NamespaceResourceScope}; pub use params::{ DeleteParams, ListParams, Patch, PatchParams, PostParams, Preconditions, PropagationPolicy, ValidationDirective, @@ -81,7 +81,7 @@ impl Api { /// This function accepts `K::DynamicType` so it can be used with dynamic resources. pub fn namespaced_with(client: Client, ns: &str, dyntype: &K::DynamicType) -> Self where - K: Resource, + K: Resource, { // TODO: inspect dyntype scope to verify somehow? let url = K::url_path(dyntype, Some(ns)); @@ -102,7 +102,7 @@ impl Api { /// namespace when deployed in-cluster. pub fn default_namespaced_with(client: Client, dyntype: &K::DynamicType) -> Self where - K: Resource, + K: Resource, { let ns = client.default_ns().to_string(); Self::namespaced_with(client, &ns, dyntype) diff --git a/kube-core/src/dynamic.rs b/kube-core/src/dynamic.rs index ff22ab0ea..2886e63df 100644 --- a/kube-core/src/dynamic.rs +++ b/kube-core/src/dynamic.rs @@ -5,7 +5,7 @@ pub use crate::discovery::ApiResource; use crate::{ metadata::TypeMeta, - resource::{DynamicScope, Resource}, + resource::{DynamicResourceScope, Resource}, }; use k8s_openapi::apimachinery::pkg::apis::meta::v1::ObjectMeta; use std::borrow::Cow; @@ -60,7 +60,7 @@ impl DynamicObject { impl Resource for DynamicObject { type DynamicType = ApiResource; - type Scope = DynamicScope; + type Scope = DynamicResourceScope; fn group(dt: &ApiResource) -> Cow<'_, str> { dt.group.as_str().into() diff --git a/kube-core/src/lib.rs b/kube-core/src/lib.rs index 3628f2e00..f19474697 100644 --- a/kube-core/src/lib.rs +++ b/kube-core/src/lib.rs @@ -38,7 +38,7 @@ pub use request::Request; mod resource; pub use resource::{ - ClusterResourceScope, DynamicScope, NamespaceResourceScope, Resource, ResourceExt, ResourceScope, + ClusterResourceScope, DynamicResourceScope, NamespaceResourceScope, Resource, ResourceExt, ResourceScope, SubResourceScope, }; diff --git a/kube-core/src/object.rs b/kube-core/src/object.rs index 5f43aaf7e..bb17a8d8f 100644 --- a/kube-core/src/object.rs +++ b/kube-core/src/object.rs @@ -2,7 +2,7 @@ use crate::{ discovery::ApiResource, metadata::{ListMeta, ObjectMeta, TypeMeta}, - resource::{DynamicScope, Resource}, + resource::{DynamicResourceScope, Resource}, }; use serde::{Deserialize, Serialize}; use std::borrow::Cow; @@ -216,7 +216,7 @@ where U: Clone, { type DynamicType = ApiResource; - type Scope = DynamicScope; + type Scope = DynamicResourceScope; fn group(dt: &ApiResource) -> Cow<'_, str> { dt.group.as_str().into() diff --git a/kube-core/src/resource.rs b/kube-core/src/resource.rs index 130fac704..dcec84578 100644 --- a/kube-core/src/resource.rs +++ b/kube-core/src/resource.rs @@ -9,8 +9,8 @@ use std::{borrow::Cow, collections::BTreeMap}; pub use k8s_openapi::{ClusterResourceScope, NamespaceResourceScope, ResourceScope, SubResourceScope}; /// Indicates that a [`Resource`] is of an indeterminate dynamic scope. -pub struct DynamicScope {} -impl ResourceScope for DynamicScope {} +pub struct DynamicResourceScope {} +impl ResourceScope for DynamicResourceScope {} /// An accessor trait for a kubernetes Resource. /// @@ -36,7 +36,7 @@ pub trait Resource { /// Type information for the api scope of the resource when known at compile time /// /// Types from k8s_openapi come with an explicit k8s_openapi::ResourceScope - /// Dynamic types should select `DynamicScope` + /// Dynamic types should select `Scope = DynamicResourceScope` type Scope; /// Returns kind of this object