1pub mod controller;
3pub use crate::controller::*;
4pub mod apis;
5
6pub mod configmap;
7pub mod postgres_exporter;
8pub mod telemetry;
10
11mod exec;
12mod metrics;
14pub use metrics::Metrics;
15mod config;
16mod cronjob;
17pub mod defaults;
18mod extensions;
19#[cfg(test)] pub mod fixtures;
20mod psql;
21mod rbac;
22mod secret;
23mod service;
24mod statefulset;
25use thiserror::Error;
26
27#[derive(Error, Debug)]
28pub enum Error {
29 #[error("An error occurred in kube-exec: {0}")]
30 KubeExecError(String),
31
32 #[error("SerializationError: {0}")]
33 SerializationError(#[source] serde_json::Error),
34
35 #[error("Kube Error: {0}")]
36 KubeError(#[from] kube::Error),
37
38 #[error("Finalizer Error: {0}")]
39 FinalizerError(#[source] Box<kube::runtime::finalizer::Error<Error>>),
42
43 #[error("Pod Error: {0}")]
44 PodError(String),
45}
46pub type Result<T, E = Error> = std::result::Result<T, E>;
47
48impl Error {
49 pub fn metric_label(&self) -> String {
50 format!("{self:?}").to_lowercase()
51 }
52}