From 7868bd9643675fec9f7eaec9b4bc55bd888d8cc5 Mon Sep 17 00:00:00 2001 From: Simon Popugaev Date: Mon, 1 Jul 2024 20:05:52 +0300 Subject: [PATCH] config workaround --- golem-shard-manager/config/shard-manager.toml | 4 ++-- golem-shard-manager/src/lib.rs | 6 +++--- golem-shard-manager/src/model.rs | 3 +++ golem-shard-manager/src/shard_manager_config.rs | 12 ++++++++---- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/golem-shard-manager/config/shard-manager.toml b/golem-shard-manager/config/shard-manager.toml index dad2f2c32e..b9749ddc01 100644 --- a/golem-shard-manager/config/shard-manager.toml +++ b/golem-shard-manager/config/shard-manager.toml @@ -36,6 +36,6 @@ delay = "10s" [health_check.mode] type = "Grpc" #type = "K8s" -# -#[health_check.mode.config] + +[health_check.mode.config] #namespace = "default" diff --git a/golem-shard-manager/src/lib.rs b/golem-shard-manager/src/lib.rs index e3f6e43bec..77531289f7 100644 --- a/golem-shard-manager/src/lib.rs +++ b/golem-shard-manager/src/lib.rs @@ -45,7 +45,7 @@ use tracing_subscriber::EnvFilter; use worker_executor::{WorkerExecutorService, WorkerExecutorServiceDefault}; use crate::http_server::HttpServerImpl; -use crate::shard_manager_config::HealthCheckMode; +use crate::shard_manager_config::{HealthCheckK8sConfig, HealthCheckMode}; pub struct ShardManagerServiceImpl { shard_management: ShardManagement, @@ -247,12 +247,12 @@ async fn async_main( let health_check: Arc = match &shard_manager_config.health_check.mode { - HealthCheckMode::Grpc => Arc::new(GrpcHealthCheck::new( + HealthCheckMode::Grpc(_) => Arc::new(GrpcHealthCheck::new( worker_executors.clone(), shard_manager_config.worker_executors.retries.clone(), )), #[cfg(feature = "kubernetes")] - HealthCheckMode::K8s { namespace } => Arc::new( + HealthCheckMode::K8s(HealthCheckK8sConfig { namespace }) => Arc::new( crate::healthcheck::kubernetes::KubernetesHealthCheck::new( namespace.clone(), shard_manager_config.worker_executors.retries.clone(), diff --git a/golem-shard-manager/src/model.rs b/golem-shard-manager/src/model.rs index aa051a46d2..280795a1fd 100644 --- a/golem-shard-manager/src/model.rs +++ b/golem-shard-manager/src/model.rs @@ -501,3 +501,6 @@ fn shard_ids_to_ranges<'a, T: Iterator>(ids: T) -> Vec