Skip to content

Commit

Permalink
chore: remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
jahzielv committed Sep 24, 2024
1 parent 470ddbb commit 2d4121b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
5 changes: 0 additions & 5 deletions server/datastore/mysql/apple_mdm.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ import (
"errors"
"fmt"
"io"
"log/slog"
"math"
"os"
"runtime"
"strings"
"time"

Expand Down Expand Up @@ -1986,7 +1984,6 @@ func (ds *Datastore) bulkSetPendingMDMAppleHostProfilesDB(
}

updatedDB = true
slog.With("filename", "server/datastore/mysql/apple_mdm.go", "func", func() string { counter, _, _, _ := runtime.Caller(1); return runtime.FuncForPC(counter).Name() }()).Info("JVE_LOG: going to update profile ", "args", args)
baseStmt := fmt.Sprintf(`
INSERT INTO host_mdm_apple_profiles (
profile_uuid,
Expand Down Expand Up @@ -2088,15 +2085,13 @@ func (ds *Datastore) bulkSetPendingMDMAppleHostProfilesDB(

for _, p := range currentProfiles {
if _, ok := profileIntersection.GetMatchingProfileInDesiredState(p); ok {
slog.With("filename", "server/datastore/mysql/apple_mdm.go", "func", func() string { counter, _, _, _ := runtime.Caller(1); return runtime.FuncForPC(counter).Name() }()).Info("JVE_LOG: was it in profileIntersection?")
continue
}
// If the profile wasn't installed, then we do not want to change the operation to "Remove".
// Doing so will result in Fleet attempting to remove a profile that doesn't exist on the
// host (since the installation failed). Skipping it here will lead to it being removed from
// the host in Fleet during profile reconciliation, which is what we want.
if p.DidNotInstallOnHost() {
slog.With("filename", "server/datastore/mysql/apple_mdm.go", "func", func() string { counter, _, _, _ := runtime.Caller(1); return runtime.FuncForPC(counter).Name() }()).Info("JVE_LOG: we didn't install so we should remove later ")
continue
}
profilesToInsert[fmt.Sprintf("%s\n%s", p.HostUUID, p.ProfileUUID)] = &fleet.MDMAppleProfilePayload{
Expand Down
14 changes: 0 additions & 14 deletions server/service/apple_mdm.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ import (
"errors"
"fmt"
"io"
"log/slog"
"mime/multipart"
"net/http"
"os"
"runtime"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -782,7 +780,6 @@ func (svc *Service) DeleteMDMAppleConfigProfile(ctx context.Context, profileUUID
}

if hp.Status == nil && hp.OperationType == fleet.MDMOperationTypeInstall && hp.CommandUUID == "" {
slog.With("filename", "server/service/apple_mdm.go", "func", func() string { counter, _, _, _ := runtime.Caller(1); return runtime.FuncForPC(counter).Name() }()).Info("JVE_LOG: we should delete this profile ", "name", hp.Name)
if err := svc.ds.DeleteHostMDMAppleProfileByUUID(ctx, cp.ProfileUUID); err != nil {
return ctxerr.Wrap(ctx, err, "deleting host mdm apple profile")
}
Expand All @@ -793,17 +790,6 @@ func (svc *Service) DeleteMDMAppleConfigProfile(ctx context.Context, profileUUID
}
}

// toRemove, err := svc.ds.ListMDMAppleProfilesToRemove(ctx)
// if err != nil {
// return ctxerr.Wrap(ctx, err, "getting profiles to remove")
// }

// for _, p := range toRemove {
// if p.DidNotInstallOnHost() {
// slog.With("filename", "server/service/apple_mdm.go", "func", func() string { counter, _, _, _ := runtime.Caller(1); return runtime.FuncForPC(counter).Name() }()).Info("JVE_LOG: GOT EM: didn't install profile on host ", "name", p.ProfileName)
// }
// }

var (
actTeamID *uint
actTeamName *string
Expand Down

0 comments on commit 2d4121b

Please sign in to comment.