Struct k8s_controller::Controller
source · pub struct Controller<Ctx>where
Ctx: Send + Sync + 'static + Context,
Ctx::Error: Send + Sync + 'static,
for<'de> Ctx::Resource: Send + Sync + 'static + Clone + Debug + Serialize + Deserialize<'de>,
<Ctx::Resource as Resource>::DynamicType: Eq + Clone + Hash + Default + Debug + Unpin,{ /* private fields */ }
Expand description
The Controller
watches a set of resources, calling methods on the
provided Context
when events occur.
Implementations§
source§impl<Ctx> Controller<Ctx>
impl<Ctx> Controller<Ctx>
sourcepub fn namespaced(
client: Client,
context: Ctx,
namespace: &str,
wc: Config,
) -> Self
pub fn namespaced( client: Client, context: Ctx, namespace: &str, wc: Config, ) -> Self
Creates a new controller for a namespaced resource using the given
client
. The context
given determines the type of resource
to watch (via the Context::Resource
type provided as part of
the trait implementation). The resources to be watched will be
limited to resources in the given namespace
. A watcher::Config
can be given to limit the resources watched (for instance,
watcher::Config::default().labels("app=myapp")
).
sourcepub fn namespaced_all(client: Client, context: Ctx, wc: Config) -> Self
pub fn namespaced_all(client: Client, context: Ctx, wc: Config) -> Self
Creates a new controller for a namespaced resource using the given
client
. The context
given determines the type of resource to
watch (via the Context::Resource
type provided as part of the
trait implementation). The resources to be watched will not be
limited by namespace. A watcher::Config
can be given to limit the
resources watched (for instance,
watcher::Config::default().labels("app=myapp")
).
sourcepub fn cluster(client: Client, context: Ctx, wc: Config) -> Self
pub fn cluster(client: Client, context: Ctx, wc: Config) -> Self
Creates a new controller for a cluster-scoped resource using the
given client
. The context
given determines the type of resource
to watch (via the Context::Resource
type provided as part of the
trait implementation). A watcher::Config
can be given to limit the
resources watched (for instance,
watcher::Config::default().labels("app=myapp")
).