diff --git a/src/app_state.rs b/src/app_state.rs index ac09336..7fa482b 100644 --- a/src/app_state.rs +++ b/src/app_state.rs @@ -1,13 +1,7 @@ use std::collections::HashSet; use std::sync::Arc; -use kube::Client; - -use crate::gitea_client::GiteaClient; - #[derive(Clone)] pub(crate) struct AppState { - pub(crate) kubernetes_client: Client, - pub(crate) gitea: GiteaClient, pub(crate) allowed_repos: Arc>, } diff --git a/src/lib.rs b/src/lib.rs index 7b27cbb..267b6a2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -47,14 +47,6 @@ pub async fn init_tracing() -> Result<(), Box> { } pub async fn launch_server() -> Result<(), Box> { - let kubernetes_client: Client = Client::try_default() - .await - .expect("Set KUBECONFIG to a valid kubernetes config."); - - let gitea_api_root = std::env::var("WEBHOOK_BRIDGE_API_ROOT")?; - let gitea_api_token = std::env::var("WEBHOOK_BRIDGE_OAUTH_TOKEN")?; - let gitea = GiteaClient::new(gitea_api_root, gitea_api_token); - let allowed_repos = std::env::var("WEBHOOK_BRIDGE_REPO_WHITELIST")?; let allowed_repos: HashSet<_> = allowed_repos .split(",") @@ -73,8 +65,6 @@ pub async fn launch_server() -> Result<(), Box> { TimeoutLayer::new(Duration::from_secs(600)), )) .with_state(AppState { - kubernetes_client, - gitea, allowed_repos: Arc::new(allowed_repos), });