From 341c09518f2790e151f4676cc6ae8fe4efaf590d Mon Sep 17 00:00:00 2001 From: Preslav Gerchev Date: Thu, 23 May 2024 15:40:10 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20wrong=20check=20for=20bloc?= =?UTF-8?q?ks=20inside=20device=20connection.=20(#4086)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Preslav --- providers/os/connection/device/device_connection.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/providers/os/connection/device/device_connection.go b/providers/os/connection/device/device_connection.go index 787ebd8683..952e2cd695 100644 --- a/providers/os/connection/device/device_connection.go +++ b/providers/os/connection/device/device_connection.go @@ -51,7 +51,7 @@ func NewDeviceConnection(connId uint32, conf *inventory.Config, asset *inventory if err != nil { return nil, err } - if len(blocks) != 0 { + if len(blocks) != 1 { // FIXME: remove this when we start scanning multiple blocks return nil, errors.New("internal>blocks size is not equal to 1.") } @@ -102,7 +102,9 @@ func NewDeviceConnection(connId uint32, conf *inventory.Config, asset *inventory // allow injecting platform ids into the device connection. we cannot always know the asset that's being scanned, e.g. // if we can scan an azure VM's disk we should be able to inject the platform ids of the VM if platformIDs, ok := conf.Options[PlatformIdInject]; ok { - asset.PlatformIds = append(asset.PlatformIds, strings.Split(platformIDs, ",")...) + platformIds := strings.Split(platformIDs, ",") + log.Debug().Strs("platform-ids", platformIds).Msg("device connection> injecting platform ids") + asset.PlatformIds = append(asset.PlatformIds, platformIds...) } return res, nil }