code: func deletionFinalizersForGarbageCollection(ctx context.Context, e *Store, accessor metav1.Object, options *metav1.DeleteOptions) (bool, []string) {
  	if !e.EnableGarbageCollection {
  		return false, []string{}
  	}
  	shouldOrphan := shouldOrphanDependents(ctx, e, accessor, options)
  	shouldDeleteDependentInForeground := shouldDeleteDependents(ctx, e, accessor, options)
  	newFinalizers := []string{}
  
  	// first remove both finalizers, add them back if needed.
  	for _, f := range accessor.GetFinalizers() {
  		if f == metav1.FinalizerOrphanDependents || f == metav1.FinalizerDeleteDependents {
  			continue
  		}
  		newFinalizers = append(newFinalizers, f)
  	}
  
  	if shouldOrphan {
  		newFinalizers = append(newFinalizers, metav1.FinalizerOrphanDependents)
  	}
  	if shouldDeleteDependentInForeground {
  		newFinalizers = append(newFinalizers, metav1.FinalizerDeleteDependents)
  	}
  
  	oldFinalizerSet := sets.NewString(accessor.GetFinalizers()...)
  	newFinalizersSet := sets.NewString(newFinalizers...)
  	if oldFinalizerSet.Equal(newFinalizersSet) {
  		return false, accessor.GetFinalizers()
  	}
  	return true, newFinalizers
  }
docs: // deletionFinalizersForGarbageCollection analyzes the object and delete options
  // to determine whether the object is in need of finalization by the garbage
  // collector. If so, returns the set of deletion finalizers to apply and a bool
  // indicating whether the finalizer list has changed and is in need of updating.
  //
  // The finalizers returned are intended to be handled by the garbage collector.
  // If garbage collection is disabled for the store, this function returns false
  // to ensure finalizers aren't set which will never be cleared.