1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! # koprs
//!
//! Generic, reusable Kubernetes resource utilities for Rust operators.
//!
//! Provides a thin, ergonomic layer on top of [`kube`] for the most common
//! operator patterns: applying and deleting resources (cluster-scoped and
//! namespaced), patching status subresources, managing finalizers, garbage
//! collecting orphaned resources, watching resources for changes, and listing
//! resources with optional label selectors.
//!
//! All functions are generic over the resource type `T` / `K` so you write the
//! pattern once and reuse it across every CRD or built-in type in your operator.
//!
//! ## Quick start
//!
//! ```no_run
//! use koprs::error::KubeGenericError;
//! use koprs::resources::apply_resource;
//! use koprs::scope::Namespaced;
//! use kube::Client;
//! use k8s_openapi::api::apps::v1::Deployment;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), KubeGenericError> {
//! let client = Client::try_default().await?;
//! let deployment: Deployment = todo!("build your desired state");
//!
//! apply_resource::<Deployment, _>(client.clone(), Namespaced("my-namespace"), &deployment, "my-operator").await?;
//! Ok(())
//! }
//! ```
pub use KubeGenericError;
pub use is_being_deleted;
pub use WatchEvent;