Handle android certificates on deletion events (#37481)

This commit is contained in:
Tim Lee
2025-12-19 16:18:24 -07:00
committed by GitHub
parent 45b162f940
commit 8774833a54
11 changed files with 548 additions and 1 deletions
+12
View File
@@ -1695,6 +1695,8 @@ type TransitionCertificateTemplatesToDeliveredFunc func(ctx context.Context, hos
type RevertHostCertificateTemplatesToPendingFunc func(ctx context.Context, hostUUID string, certificateTemplateIDs []uint) error
type SetHostCertificateTemplatesToPendingRemoveFunc func(ctx context.Context, certificateTemplateID uint) error
type GetCurrentTimeFunc func(ctx context.Context) (time.Time, error)
type UpdateOrDeleteHostMDMWindowsProfileFunc func(ctx context.Context, profile *fleet.HostMDMWindowsProfile) error
@@ -4212,6 +4214,9 @@ type DataStore struct {
RevertHostCertificateTemplatesToPendingFunc RevertHostCertificateTemplatesToPendingFunc
RevertHostCertificateTemplatesToPendingFuncInvoked bool
SetHostCertificateTemplatesToPendingRemoveFunc SetHostCertificateTemplatesToPendingRemoveFunc
SetHostCertificateTemplatesToPendingRemoveFuncInvoked bool
GetCurrentTimeFunc GetCurrentTimeFunc
GetCurrentTimeFuncInvoked bool
@@ -10079,6 +10084,13 @@ func (s *DataStore) RevertHostCertificateTemplatesToPending(ctx context.Context,
return s.RevertHostCertificateTemplatesToPendingFunc(ctx, hostUUID, certificateTemplateIDs)
}
func (s *DataStore) SetHostCertificateTemplatesToPendingRemove(ctx context.Context, certificateTemplateID uint) error {
s.mu.Lock()
s.SetHostCertificateTemplatesToPendingRemoveFuncInvoked = true
s.mu.Unlock()
return s.SetHostCertificateTemplatesToPendingRemoveFunc(ctx, certificateTemplateID)
}
func (s *DataStore) GetCurrentTime(ctx context.Context) (time.Time, error) {
s.mu.Lock()
s.GetCurrentTimeFuncInvoked = true