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 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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Mutably borrows from an owned value. Read more
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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
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
Checks if this value is equivalent to the given key. Read more
§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>
Converts
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>
Converts
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>
Wrap the input message
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>,
Applies the layer to a service and wraps it in [
Layered].§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more