From 6bc3794e9facbfc6dc8c80bbdb2d4aa99fd16f0f Mon Sep 17 00:00:00 2001 From: seph Date: Fri, 7 Jun 2024 10:57:34 -0400 Subject: [PATCH] tweak --- ee/agent/reset.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ee/agent/reset.go b/ee/agent/reset.go index 129dd7390..4f698a683 100644 --- a/ee/agent/reset.go +++ b/ee/agent/reset.go @@ -60,7 +60,7 @@ func DetectAndRemediateHardwareChange(ctx context.Context, k types.Knapsack) { hardwareUUIDChanged := false munemoChanged := false - defer k.Slogger().Log(ctx, slog.LevelDebug, "checking to see if database should be reset...", + defer k.Slogger().Log(ctx, slog.LevelDebug, "finished check to see if database should be reset...", "serial", serialChanged, "hardware_uuid", hardwareUUIDChanged, "munemo", munemoChanged, @@ -82,16 +82,16 @@ func DetectAndRemediateHardwareChange(ctx context.Context, k types.Knapsack) { } if serialChanged || hardwareUUIDChanged || munemoChanged { - k.Slogger().Log(ctx, slog.LevelWarn, "detected new hardware or enrollment", - "serial_changed", serialChanged, - "hardware_uuid_changed", hardwareUUIDChanged, - "tenant_munemo_changed", munemoChanged, - ) - // In the future, we can proceed with backing up and resetting the database. // For now, we are only logging that we detected the change until we have a dependable // hardware change detection method - see issue here https://github.com/kolide/launcher/issues/1346 /* + k.Slogger().Log(ctx, slog.LevelWarn, "resetting the database", + "serial_changed", serialChanged, + "hardware_uuid_changed", hardwareUUIDChanged, + "tenant_munemo_changed", munemoChanged, + ) + if err := ResetDatabase(ctx, k, resetReasonNewHardwareOrEnrollmentDetected); err != nil { k.Slogger().Log(ctx, slog.LevelError, "failed to reset database", "err", err) }