fix: reconcile configured APT effect without retroactive acceptance and retain host reboot evidence
Rust development slice / linux (push) Failing after 6s

This commit is contained in:
2026-11-13 20:00:20 +01:00
parent 34d695a778
commit b08734065a
26 changed files with 2006 additions and 36 deletions
+26
View File
@@ -5,6 +5,7 @@ use anyhow::{Context, Result, bail, ensure};
use chrono::{DateTime, Utc};
use rmm_domain::jobs::{ExecutionPermitPayload, JobPayload, hash};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::{
collections::BTreeMap,
fs::{self, File, OpenOptions},
@@ -1169,6 +1170,31 @@ fn map_driver_result(
"APT_FIXTURE_PAYLOAD_EVIDENCE"
);
if bootstrap {
let before = result
.evidence
.get("host_reboot_required_before")
.and_then(Value::as_bool);
let after = result
.evidence
.get("host_reboot_required_after")
.and_then(Value::as_bool);
ensure!(
before.is_some()
&& before == after
&& after
== result
.evidence
.get("reboot_required")
.and_then(Value::as_bool)
&& result.evidence.get("reboot_required_introduced")
== Some(&serde_json::json!(false))
&& result
.evidence
.get("host_reboot_before_sha256")
.and_then(Value::as_str)
.is_some_and(|s| sha(s).is_ok()),
"APT_NATIVE_HOST_REBOOT_BASELINE_REQUIRED"
);
if let Some(recovery) = &m.native_recovery {
ensure!(
result.evidence.get("native_recovery") == Some(&serde_json::json!(true))