Skip to content

Commit b8dae4c

Browse files
fix(procmgr): restore reload helpers after stack rebase onto spawn-profiles
Keep config-gates on stop().await while adopting the ProcessManager reload helper split from spawn-profiles, and drop the obsolete align-reload commit.
1 parent ff38e8d commit b8dae4c

6 files changed

Lines changed: 126 additions & 542 deletions

File tree

pkg/procmgr/rust/src/config_gate.rs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// This product includes software developed at Datadog (https://www.datadoghq.com/).
44
// Copyright 2026-present Datadog, Inc.
55

6-
7-
86
mod env_bindings;
97
mod system_probe;
108
mod yaml_load;
@@ -531,9 +529,7 @@ pub fn condition_config_summary(conditions: &[ConditionConfigFile]) -> String {
531529
.iter()
532530
.flat_map(|file| {
533531
let path = expand_env_vars(&file.path);
534-
file.keys
535-
.iter()
536-
.map(move |key| format!("{path}:{key}"))
532+
file.keys.iter().map(move |key| format!("{path}:{key}"))
537533
})
538534
.collect::<Vec<_>>()
539535
.join(", ")
@@ -1690,10 +1686,7 @@ process_config:
16901686
value_as_bool(&serde_yaml::Value::String("yes".into())),
16911687
Some(false)
16921688
);
1693-
assert_eq!(
1694-
value_as_bool(&serde_yaml::Value::Bool(true)),
1695-
Some(true)
1696-
);
1689+
assert_eq!(value_as_bool(&serde_yaml::Value::Bool(true)), Some(true));
16971690
}
16981691

16991692
#[test]
@@ -1987,9 +1980,9 @@ process_config:
19871980
let dir = tempfile::tempdir().unwrap();
19881981
let agent = write_config(dir.path(), "datadog.yaml", ALL_PROCESS_GATES_OFF);
19891982
let sysprobe = write_config(dir.path(), "system-probe.yaml", "# empty\n");
1990-
assert!(condition_config_any_met(
1991-
&process_agent_windows_conditions(agent, sysprobe)
1992-
));
1983+
assert!(condition_config_any_met(&process_agent_windows_conditions(
1984+
agent, sysprobe
1985+
)));
19931986
});
19941987
}
19951988

pkg/procmgr/rust/src/config_gate/yaml_load/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,7 @@ mod tests {
7979
fn permissive_parse_accepts_null_with_duplicate_keys() {
8080
let yaml = "network_config:\n enabled:\nsystem_probe_config:\n enabled: true\nprocess_config:\n enabled: false\nprocess_config:\n process_collection:\n enabled: true\n";
8181
let root = load_yaml(yaml).unwrap();
82-
assert_eq!(
83-
dotted(&root, "network_config.enabled"),
84-
Some(&Value::Null)
85-
);
82+
assert_eq!(dotted(&root, "network_config.enabled"), Some(&Value::Null));
8683
assert_eq!(
8784
dotted(&root, "system_probe_config.enabled"),
8885
Some(&Value::Bool(true))

pkg/procmgr/rust/src/config_gate/yaml_load/saphyr.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ impl Builder {
124124
pending_key: None,
125125
anchor,
126126
} => (pairs, anchor),
127-
Frame::Mapping { pending_key: Some(_), .. } => {
127+
Frame::Mapping {
128+
pending_key: Some(_),
129+
..
130+
} => {
128131
bail!("YAML mapping ended before value for key");
129132
}
130133
_ => bail!("YAML mapping end without matching start"),
@@ -157,7 +160,9 @@ impl Builder {
157160
fn attach(&mut self, value: Value) {
158161
match self.stack.last_mut() {
159162
None => self.root = Some(value),
160-
Some(Frame::Mapping { pairs, pending_key, .. }) => {
163+
Some(Frame::Mapping {
164+
pairs, pending_key, ..
165+
}) => {
161166
if pending_key.is_none() {
162167
*pending_key = Some(scalar_as_key(value));
163168
} else {

0 commit comments

Comments
 (0)