#![forbid(unsafe_code)]
#![allow(missing_docs)] #![allow(dead_code)]
mod controller;
mod crd;
use clap::Parser;
#[derive(Parser, Debug)]
#[command(
name = "confium-operator",
version,
about = "Kubernetes operator for Confium threshold signing"
)]
pub struct Args {
#[arg(long)]
pub kubeconfig: Option<String>,
#[arg(long)]
pub namespace: Option<String>,
#[arg(long)]
pub once: bool,
}
#[tokio::main]
async fn main() -> anyhow::Result<()> {
tracing_subscriber::fmt()
.with_env_filter(
tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| "confium_operator=info".into()),
)
.init();
let args = Args::parse();
tracing::info!("starting confium-operator");
let controller = controller::CeremonyController::new(args.namespace.clone());
if args.once {
controller.reconcile_once().await?;
} else {
controller.run().await?;
}
Ok(())
}