Skip to content

Commit

Permalink
🧹 Respect inventory-file if passed in. (#1826)
Browse files Browse the repository at this point in the history
  • Loading branch information
preslavgerchev authored Sep 21, 2023
1 parent 79b8481 commit 9739853
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions apps/cnquery/cmd/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"go.mondoo.com/cnquery"
"go.mondoo.com/cnquery/cli/config"
"go.mondoo.com/cnquery/cli/execruntime"
"go.mondoo.com/cnquery/cli/inventoryloader"
"go.mondoo.com/cnquery/cli/reporter"
"go.mondoo.com/cnquery/cli/theme"
"go.mondoo.com/cnquery/explorer"
Expand Down Expand Up @@ -162,14 +163,14 @@ func getCobraScanConfig(cmd *cobra.Command, runtime *providers.Runtime, cliRes *
log.Fatal().Err(err).Msg("failed to parse props")
}

inv, err := inventoryloader.ParseOrUse(cliRes.Asset, viper.GetBool("insecure"))
if err != nil {
log.Fatal().Err(err).Msg("failed to parse inventory")
}
conf := scanConfig{
Features: opts.GetFeatures(),
IsIncognito: viper.GetBool("incognito"),
Inventory: &inventory.Inventory{
Spec: &inventory.InventorySpec{
Assets: []*inventory.Asset{cliRes.Asset},
},
},
Features: opts.GetFeatures(),
IsIncognito: viper.GetBool("incognito"),
Inventory: inv,
QueryPackPaths: viper.GetStringSlice("querypack-bundle"),
QueryPackNames: viper.GetStringSlice("querypacks"),
Props: props,
Expand Down

0 comments on commit 9739853

Please sign in to comment.