Skip to content

Commit db453df

Browse files
mnageorgekarrv
authored andcommitted
Ignore pending DDM profiles when waiting to release a device (#18159)
#18160 # Checklist for submitter - [x] Changes file added for user-visible changes in `changes/` or `orbit/changes/`. - [x] Manual QA for all new/changed functionality
1 parent fd343dc commit db453df

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Fixed an issue with automatic release of the device after setup when a DDM profile is pending.

server/worker/apple_mdm.go

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/json"
66
"errors"
77
"fmt"
8+
"strings"
89
"time"
910

1011
"github.com/fleetdm/fleet/v4/server/contexts/ctxerr"
@@ -238,6 +239,13 @@ func (a *AppleMDM) runPostDEPReleaseDevice(ctx context.Context, args appleMDMArg
238239
return ctxerr.Wrap(ctx, err, "failed to get host MDM profiles")
239240
}
240241
for _, prof := range profs {
242+
// NOTE: DDM profiles (declarations) are ignored because while a device is
243+
// awaiting to be released, it cannot process a DDM session (at least
244+
// that's what we noticed during testing).
245+
if strings.HasPrefix(prof.ProfileUUID, fleet.MDMAppleDeclarationUUIDPrefix) {
246+
continue
247+
}
248+
241249
// if it has any pending profiles, then its profiles are not done being
242250
// delivered (installed or removed).
243251
if prof.Status == nil || *prof.Status == fleet.MDMDeliveryPending {

0 commit comments

Comments
 (0)