mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
for #17489, found an edge case during extra testing.
This commit is contained in:
parent
37885d0932
commit
a39932b013
2 changed files with 13 additions and 1 deletions
|
|
@ -1565,7 +1565,11 @@ func deduceMDMNameWindows(data map[string]string) string {
|
|||
}
|
||||
|
||||
func directIngestMDMWindows(ctx context.Context, logger log.Logger, host *fleet.Host, ds fleet.Datastore, rows []map[string]string) error {
|
||||
if len(rows) != 1 {
|
||||
if len(rows) == 0 {
|
||||
// no mdm information in the registry
|
||||
return ds.SetOrUpdateMDMData(ctx, host.ID, false, false, "", false, "", "")
|
||||
}
|
||||
if len(rows) > 1 {
|
||||
logger.Log("component", "service", "method", "directIngestMDMWindows", "warn",
|
||||
fmt.Sprintf("mdm expected single result got %d", len(rows)))
|
||||
// assume the extension is not there
|
||||
|
|
|
|||
|
|
@ -715,6 +715,14 @@ func TestDirectIngestMDMWindows(t *testing.T) {
|
|||
wantIsServer: false,
|
||||
wantServerURL: "",
|
||||
},
|
||||
{
|
||||
name: "off no rows",
|
||||
data: []map[string]string{},
|
||||
wantEnrolled: false,
|
||||
wantInstalledFromDep: false,
|
||||
wantIsServer: false,
|
||||
wantServerURL: "",
|
||||
},
|
||||
{
|
||||
name: "on automatic",
|
||||
data: []map[string]string{
|
||||
|
|
|
|||
Loading…
Reference in a new issue