From 68b368d0fa1bf0c4801b6b9e4bbbe3eeeb66e251 Mon Sep 17 00:00:00 2001 From: Mikita Iwanowski Date: Fri, 13 Dec 2024 19:38:11 +0100 Subject: [PATCH] fix: skip asset detection if already present --- providers/os/connection/device/device_connection.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/providers/os/connection/device/device_connection.go b/providers/os/connection/device/device_connection.go index f8e034f64..5ff7c7ac7 100644 --- a/providers/os/connection/device/device_connection.go +++ b/providers/os/connection/device/device_connection.go @@ -100,6 +100,11 @@ func NewDeviceConnection(connId uint32, conf *inventory.Config, asset *inventory } res.MountedDirs = append(res.MountedDirs, block.MountPoint) + if asset.Platform != nil { + log.Debug().Msg("device connection> asset already detected, skipping") + continue + } + if fsConn, err := tryDetectAsset(connId, block, conf, asset); err != nil { log.Error().Err(err).Msg("partition did not return an asset, continuing") } else {