From f8d5253d8f2903b45ba2b6bbf9c77c2885bcd464 Mon Sep 17 00:00:00 2001 From: Sarah Gillespie <73313222+gillespi314@users.noreply.github.com> Date: Mon, 8 Jan 2024 13:38:03 -0600 Subject: [PATCH] Use info-level logging for cases where a custom enrollment profile is not found by fleetd (#15952) --- orbit/cmd/orbit/orbit.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/orbit/cmd/orbit/orbit.go b/orbit/cmd/orbit/orbit.go index e8417beff6..25dcae180a 100644 --- a/orbit/cmd/orbit/orbit.go +++ b/orbit/cmd/orbit/orbit.go @@ -1008,8 +1008,14 @@ func main() { log.Info().Msg("checking for custom mdm enrollment profile with end user email") email, err := profiles.GetCustomEnrollmentProfileEndUserEmail() if err != nil { - log.Error().Err(err).Msg("get custom enrollment profile end user email") + if errors.Is(err, profiles.ErrNotFound) { + // This is fine. Many hosts will not have this profile so just log and continue. + log.Info().Msg(fmt.Sprintf("get custom enrollment profile end user email: %s", err)) + } else { + log.Error().Err(err).Msg("get custom enrollment profile end user email") + } } + if email != "" { log.Info().Msg(fmt.Sprintf("found custom end user email: %s", email)) if err := orbitClient.SetOrUpdateDeviceMappingEmail(email); err != nil {