Check env var along with app config for software inv (#2406)
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -155,7 +156,8 @@ func (d *Datastore) SaveHost(ctx context.Context, host *fleet.Host) error {
|
||||
return errors.Wrap(err, "failed to get app config to see if we need to update host users and inventory")
|
||||
}
|
||||
|
||||
if host.HostSoftware.Modified && ac.HostSettings.EnableSoftwareInventory && len(host.HostSoftware.Software) > 0 {
|
||||
softwareInventoryEnabled := os.Getenv("FLEET_BETA_SOFTWARE_INVENTORY") != "" || ac.HostSettings.EnableSoftwareInventory
|
||||
if host.HostSoftware.Modified && softwareInventoryEnabled && len(host.HostSoftware.Software) > 0 {
|
||||
if err := saveHostSoftwareDB(ctx, tx, host); err != nil {
|
||||
return errors.Wrap(err, "failed to save host software")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user