fix: hide values of WHITELIST_ENVS

This commit is contained in:
Ruben Fiszel
2025-02-04 22:11:05 +01:00
parent f0bab9c1c0
commit 8e0647833a
+8 -1
View File
@@ -907,7 +907,7 @@ impl Default for WorkerConfigOpt {
}
}
#[derive(PartialEq, Debug, Clone)]
#[derive(PartialEq, Clone)]
pub struct WorkerConfig {
pub worker_tags: Vec<String>,
pub priority_tags_sorted: Vec<PriorityTags>,
@@ -919,6 +919,13 @@ pub struct WorkerConfig {
pub env_vars: HashMap<String, String>,
}
impl std::fmt::Debug for WorkerConfig {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "WorkerConfig {{ worker_tags: {:?}, priority_tags_sorted: {:?}, dedicated_worker: {:?}, init_bash: {:?}, cache_clear: {:?}, additional_python_paths: {:?}, pip_local_dependencies: {:?}, env_vars: {:?} }}",
self.worker_tags, self.priority_tags_sorted, self.dedicated_worker, self.init_bash, self.cache_clear, self.additional_python_paths, self.pip_local_dependencies, self.env_vars.iter().map(|(k, v)| format!("{}: {}{} ({} chars)", k, &v[..3.min(v.len())], "***", v.len())).collect::<Vec<String>>().join(", "))
}
}
#[derive(PartialEq, Debug, Clone)]
pub struct PriorityTags {
pub priority: u8,