diff --git a/charts/osirose-new/values.yaml b/charts/osirose-new/values.yaml index c24d266..e628a40 100644 --- a/charts/osirose-new/values.yaml +++ b/charts/osirose-new/values.yaml @@ -91,6 +91,10 @@ services: env: SERVICE_PORT: 50054 LOG_LEVEL: "debug" + LOGIC_LOG_LEVEL: "debug" +# MAP_IDS: "1,2,3,4,5,6,8,9,10,11,15,16,17,18,20,21,22,23,24,25,26,27,28,29,31,32,33,34,35,36,37,40,42,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,70,71,72,73,74,75,76,77,78,79,80" + MAP_IDS: "1,2,3,4,5,6,8,9,10,11,15,16,17,18,20" + WORLD_SERVICE_NAME: "Athena" service: annotations: name: "Athena" diff --git a/world-service/src/k8s_orchestrator.rs b/world-service/src/k8s_orchestrator.rs index 590ea22..27f182b 100644 --- a/world-service/src/k8s_orchestrator.rs +++ b/world-service/src/k8s_orchestrator.rs @@ -1,3 +1,4 @@ +use std::env; use kube::{ api::{Api, PostParams, DeleteParams}, Client, @@ -21,6 +22,10 @@ pub struct K8sOrchestrator { namespace: String, } +fn get_log_level() -> String { + env::var("LOGIC_LOG_LEVEL").unwrap_or_else(|_| env::var("LOG_LEVEL").unwrap_or_else(|_| "info".to_string())) +} + impl K8sOrchestrator { /// Creates a new orchestrator for the given namespace. pub async fn new(namespace: &str) -> Result> { @@ -61,10 +66,16 @@ impl K8sOrchestrator { "containerPort": 50056, "name": "grpc" }], - "env": [{ - "name": "MAP_ID", - "value": map_id_str - }], + "env": [ + { + "name": "MAP_ID", + "value": map_id_str + }, + { + "name": "LOG_LEVEL", + "value": get_log_level() + } + ], "volumeMounts": [{ "name": "game-data", "mountPath": "/opt/data", diff --git a/world-service/src/main.rs b/world-service/src/main.rs index 258740d..3d3c3b8 100644 --- a/world-service/src/main.rs +++ b/world-service/src/main.rs @@ -49,7 +49,7 @@ async fn main() -> Result<(), Box> { } Err(e) => { if e.to_string().contains("AlreadyExists") { - info!("Game-logic instance already exists: {}", e); + warn!("Game-logic instance already exists: {}", e); // No reason to return an error here. //TODO: We may want to check to make sure the pod is working correctly. } else {