Use info-level logging for cases where a custom enrollment profile is not found by fleetd (#15952)

This commit is contained in:
Sarah Gillespie 2024-01-08 13:38:03 -06:00 committed by GitHub
parent 9f7cf607bb
commit f8d5253d8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {