pub enum NamespaceScope {
All,
Namespaces(Vec<String>),
}Expand description
The set of namespaces the operator watches and manages.
Variants§
All
Watch every namespace cluster-wide. Requires cluster-wide RBAC (ClusterRole + ClusterRoleBinding). This is the default.
Namespaces(Vec<String>)
Watch only the listed namespaces. Requires only per-namespace RBAC (Role + RoleBinding in each namespace). Never empty.
Implementations§
Source§impl NamespaceScope
impl NamespaceScope
Sourcepub fn parse(raw: Option<&str>) -> Self
pub fn parse(raw: Option<&str>) -> Self
Parse a WATCH_NAMESPACES_ENV value into a scope.
None, empty, or whitespace-only →NamespaceScope::All(backward compatible: the operator keeps watching cluster-wide).- A comma-separated list →
NamespaceScope::Namespaceswith each entry trimmed, empty entries dropped, and duplicates removed while preserving first-seen order. If every entry is empty it falls back toNamespaceScope::All.
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Load the scope from the WATCH_NAMESPACES_ENV environment variable.
Sourcepub fn api_targets(&self) -> Vec<Option<&str>>
pub fn api_targets(&self) -> Vec<Option<&str>>
The namespace targets to build Api handles from, one per watch.
None means “cluster-wide” (build with Api::all); Some(ns) means
“this namespace only” (build with Api::namespaced). The result is
never empty — an empty target list would silently disable every
watch, leaving the operator healthy but reconciling nothing.
NamespaceScope::All deliberately yields exactly one None target so
the default deployment keeps its current single-watch-per-kind shape,
byte-for-byte. All the fan-out risk is confined to the opt-in scoped mode.
Sourcepub fn namespaces(&self) -> &[String]
pub fn namespaces(&self) -> &[String]
The watched namespaces, or an empty slice when cluster-wide.
Trait Implementations§
Source§impl Clone for NamespaceScope
impl Clone for NamespaceScope
Source§fn clone(&self) -> NamespaceScope
fn clone(&self) -> NamespaceScope
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NamespaceScope
impl Debug for NamespaceScope
Source§impl PartialEq for NamespaceScope
impl PartialEq for NamespaceScope
impl Eq for NamespaceScope
impl StructuralPartialEq for NamespaceScope
Auto Trait Implementations§
impl Freeze for NamespaceScope
impl RefUnwindSafe for NamespaceScope
impl Send for NamespaceScope
impl Sync for NamespaceScope
impl Unpin for NamespaceScope
impl UnwindSafe for NamespaceScope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].