pub struct Controller<K>{ /* private fields */ }Available on crate feature
k8s only.Expand description
One controller: a kind, what it owns, how it reconciles. See the module docs.
Implementations§
Source§impl<K> Controller<K>
impl<K> Controller<K>
Sourcepub fn new(api: Api<K>) -> Controller<K>
pub fn new(api: Api<K>) -> Controller<K>
Watch api’s objects (Api::all or Api::namespaced).
Sourcepub fn watching(self, config: Config) -> Controller<K>
pub fn watching(self, config: Config) -> Controller<K>
Only the objects config selects (labels, fields).
Sourcepub fn owns<C>(self, api: Api<C>) -> Controller<K>
pub fn owns<C>(self, api: Api<C>) -> Controller<K>
Also reconcile an object when a C it owns (an owner reference)
changes — the Deployment of a custom resource, say.
Sourcepub fn reconcile<F, Fut>(self, f: F) -> Controller<K>
pub fn reconcile<F, Fut>(self, f: F) -> Controller<K>
The reconcile function: make the world match the object, answer when to look again.
Sourcepub fn finalizer<F, Fut>(self, name: &str, cleanup: F) -> Controller<K>
pub fn finalizer<F, Fut>(self, name: &str, cleanup: F) -> Controller<K>
Add the finalizer name to every object and run cleanup when one
is deleted; the finalizer is removed (letting the deletion finish)
once cleanup succeeds.
Sourcepub fn on_error(self, first_delay: Duration) -> Controller<K>
pub fn on_error(self, first_delay: Duration) -> Controller<K>
The first delay before retrying a failed reconcile (doubling per failure of the same object, up to 5 min). Default 5 s.
Sourcepub fn rule(self, rule: Rule) -> Controller<K>
pub fn rule(self, rule: Rule) -> Controller<K>
Extra RBAC rules the reconcile needs (reading Secrets, say).
Trait Implementations§
Source§impl<K> Runnable for Controller<K>
impl<K> Runnable for Controller<K>
Auto Trait Implementations§
impl<K> !RefUnwindSafe for Controller<K>
impl<K> !Sync for Controller<K>
impl<K> !UnwindSafe for Controller<K>
impl<K> Forget for Controller<K>
impl<K> Freeze for Controller<K>where
Api<K>: Freeze,
Vec<Box<dyn FnOnce(Controller<K>, &Client) -> Controller<K> + Send>>: Freeze,
Option<Arc<dyn Fn(Arc<K>, Arc<Context>) -> Pin<Box<dyn Future<Output = Result<Action, Error>> + Send>> + Send + Sync>>: Freeze,
Option<(String, Arc<dyn Fn(Arc<K>, Arc<Context>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>> + Send + Sync>)>: Freeze,
impl<K> Move for Controller<K>
impl<K> Send for Controller<K>where
Api<K>: Send,
Vec<Box<dyn FnOnce(Controller<K>, &Client) -> Controller<K> + Send>>: Send,
Option<Arc<dyn Fn(Arc<K>, Arc<Context>) -> Pin<Box<dyn Future<Output = Result<Action, Error>> + Send>> + Send + Sync>>: Send,
Option<(String, Arc<dyn Fn(Arc<K>, Arc<Context>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>> + Send + Sync>)>: Send,
impl<K> Unpin for Controller<K>where
Api<K>: Unpin,
Vec<Box<dyn FnOnce(Controller<K>, &Client) -> Controller<K> + Send>>: Unpin,
Option<Arc<dyn Fn(Arc<K>, Arc<Context>) -> Pin<Box<dyn Future<Output = Result<Action, Error>> + Send>> + Send + Sync>>: Unpin,
Option<(String, Arc<dyn Fn(Arc<K>, Arc<Context>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>> + Send + Sync>)>: Unpin,
impl<K> UnsafeUnpin for Controller<K>where
Api<K>: UnsafeUnpin,
Vec<Box<dyn FnOnce(Controller<K>, &Client) -> Controller<K> + Send>>: UnsafeUnpin,
Option<Arc<dyn Fn(Arc<K>, Arc<Context>) -> Pin<Box<dyn Future<Output = Result<Action, Error>> + Send>> + Send + Sync>>: UnsafeUnpin,
Option<(String, Arc<dyn Fn(Arc<K>, Arc<Context>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>> + Send + Sync>)>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§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,
Available on crate feature
map-response-body only.Apply a transformation to the response body. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using gRPC headers. Read more