brokerd: escape container errors in the log; prefix and quote two messages

Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
This commit is contained in:
2026-09-23 16:10:54 -07:00
parent 93539dbead
commit e69ba632e6
6 changed files with 220 additions and 7 deletions
+8 -4
View File
@@ -214,16 +214,20 @@ impl Podman {
truncated,
}),
Some(2) => {
(self.log)(err);
(self.log)(&format!("brokerd: {name}: the tool could not run: {err:?}"));
Err(RunError::Failed(COULD_NOT_RUN.to_string()))
}
Some(125..=127) => {
(self.log)(&format!("{err}\n{RUNBOOK}"));
(self.log)(&format!(
"brokerd: podman could not start {name}: {err:?}\n{RUNBOOK}"
));
Err(RunError::Unavailable(CANNOT_START.to_string()))
}
Some(137) => Err(RunError::Failed(KILLED.to_string())),
_ => {
(self.log)(&format!("brokerd: container {name} exited {status}\n{err}"));
(self.log)(&format!(
"brokerd: container {name} exited {status}: {err:?}"
));
Err(RunError::Failed(UNEXPECTED.to_string()))
}
},
@@ -302,7 +306,7 @@ impl Podman {
Ok(output) => {
let stderr = String::from_utf8_lossy(&output.stderr).into_owned();
(self.log)(&format!(
"brokerd: podman could not start {name}-egress: {stderr}\n{RUNBOOK}"
"brokerd: podman could not start {name}-egress: {stderr:?}\n{RUNBOOK}"
));
return Err(RunError::Unavailable(CANNOT_START.to_string()));
}