Skip to content

Commit

Permalink
🐛 Fix wrong check for blocks inside device connection. (#4086)
Browse files Browse the repository at this point in the history
Signed-off-by: Preslav <[email protected]>
  • Loading branch information
preslavgerchev authored May 23, 2024
1 parent 7ad8989 commit 341c095
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions providers/os/connection/device/device_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 341c095

Please sign in to comment.