fix: add WM_WORKER_GROUP to get worker group from script

This commit is contained in:
Ruben Fiszel
2024-05-01 21:22:53 +02:00
parent d7ef9a1062
commit 4032737cd4
+7 -1
View File
@@ -10,7 +10,7 @@ use magic_crypt::{MagicCrypt256, MagicCryptTrait};
use serde::{Deserialize, Serialize};
use sqlx::{Postgres, Transaction};
use crate::{BASE_URL, DB};
use crate::{worker::WORKER_GROUP, BASE_URL, DB};
lazy_static::lazy_static! {
pub static ref SECRET_SALT: Option<String> = std::env::var("SECRET_SALT").ok();
@@ -300,6 +300,12 @@ pub async fn get_reserved_variables(
description: "OIDC JWT token (EE only)".to_string(),
is_custom: false,
},
ContextualVariable {
name: "WM_WORKER_GROUP".to_string(),
value: WORKER_GROUP.clone(),
description: "name of the worker group the job is running on".to_string(),
is_custom: false,
},
].into_iter().chain( sqlx::query_as::<_, (String, String)>(
"SELECT name, value FROM workspace_env WHERE workspace_id = $1",
)