code: func shouldOrphanDependents(ctx context.Context, e *Store, accessor metav1.Object, options *metav1.DeleteOptions) bool {
  	// Get default GC policy from this REST object type
  	gcStrategy, ok := e.DeleteStrategy.(rest.GarbageCollectionDeleteStrategy)
  	var defaultGCPolicy rest.GarbageCollectionPolicy
  	if ok {
  		defaultGCPolicy = gcStrategy.DefaultGarbageCollectionPolicy(ctx)
  	}
  
  	if defaultGCPolicy == rest.Unsupported {
  		// return  false to indicate that we should NOT orphan
  		return false
  	}
  
  	// An explicit policy was set at deletion time, that overrides everything
  	if options != nil && options.OrphanDependents != nil {
  		return *options.OrphanDependents
  	}
  	if options != nil && options.PropagationPolicy != nil {
  		switch *options.PropagationPolicy {
  		case metav1.DeletePropagationOrphan:
  			return true
  		case metav1.DeletePropagationBackground, metav1.DeletePropagationForeground:
  			return false
  		}
  	}
  
  	// If a finalizer is set in the object, it overrides the default
  	// validation should make sure the two cases won't be true at the same time.
  	finalizers := accessor.GetFinalizers()
  	for _, f := range finalizers {
  		switch f {
  		case metav1.FinalizerOrphanDependents:
  			return true
  		case metav1.FinalizerDeleteDependents:
  			return false
  		}
  	}
  
  	// Get default orphan policy from this REST object type if it exists
  	if defaultGCPolicy == rest.OrphanDependents {
  		return true
  	}
  	return false
  }
docs: // shouldOrphanDependents returns true if the finalizer for orphaning should be set
  // updated for FinalizerOrphanDependents. In the order of highest to lowest
  // priority, there are three factors affect whether to add/remove the
  // FinalizerOrphanDependents: options, existing finalizers of the object,
  // and e.DeleteStrategy.DefaultGarbageCollectionPolicy.