Add a kubernetes client.
This commit is contained in:
@@ -6,6 +6,7 @@ use axum::routing::get;
|
||||
use axum::routing::post;
|
||||
use axum::Json;
|
||||
use axum::Router;
|
||||
use kube::Client;
|
||||
use serde::Serialize;
|
||||
use tokio::signal;
|
||||
use tower_http::timeout::TimeoutLayer;
|
||||
@@ -28,6 +29,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
)
|
||||
.with(tracing_subscriber::fmt::layer())
|
||||
.init();
|
||||
|
||||
let kubernetes_client: Client = Client::try_default()
|
||||
.await
|
||||
.expect("Set KUBECONFIG to a valid kubernetes config.");
|
||||
|
||||
let app = Router::new()
|
||||
.route("/health", get(health))
|
||||
.route("/hook", post(hook))
|
||||
|
||||
Reference in New Issue
Block a user