fix(scan): removing a target's last controller clears its components and alerts
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 5m2s
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 22m48s
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 5m2s
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 22m48s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
This commit is contained in:
1 parent
d75dd85e2e
commit
fa60318c19
1 file changed
+5
-4
@@ -1928,7 +1928,9 @@ impl PipelineOrchestrator {
|
||||
// A control application known only by the Siemens controllers
|
||||
// it runs on (SPS item 4a): they are its SBOM, matched against
|
||||
// Siemens' advisories as with a project.
|
||||
if !target.devices.is_empty() {
|
||||
// Also when the last one was removed, so its components and
|
||||
// alerts go with it.
|
||||
if target.target_type == TargetType::PlcSps || !target.devices.is_empty() {
|
||||
let devices =
|
||||
crate::pipeline::sbom::devices::entries(&target.devices, &target_id);
|
||||
if let Err(e) = self
|
||||
@@ -2321,9 +2323,8 @@ impl PipelineOrchestrator {
|
||||
scan_run_id: &str,
|
||||
mut entries: Vec<SbomEntry>,
|
||||
) -> Result<(), AgentError> {
|
||||
if entries.is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
// Empty entries are stored too: the components and alerts of the
|
||||
// last scan are then gone (callers skip it when nothing was read).
|
||||
crate::pipeline::component_changes::record(
|
||||
&self.db,
|
||||
scan_run_id,
|
||||
|
||||
Reference in new issue
Block a user