code: func (podStrategy) CheckGracefulDelete(ctx context.Context, obj runtime.Object, options *metav1.DeleteOptions) bool {
  	if options == nil {
  		return false
  	}
  	pod := obj.(*api.Pod)
  	period := int64(0)
  	// user has specified a value
  	if options.GracePeriodSeconds != nil {
  		period = *options.GracePeriodSeconds
  	} else {
  		// use the default value if set, or deletes the pod immediately (0)
  		if pod.Spec.TerminationGracePeriodSeconds != nil {
  			period = *pod.Spec.TerminationGracePeriodSeconds
  		}
  	}
  	// if the pod is not scheduled, delete immediately
  	if len(pod.Spec.NodeName) == 0 {
  		period = 0
  	}
  	// if the pod is already terminated, delete immediately
  	if pod.Status.Phase == api.PodFailed || pod.Status.Phase == api.PodSucceeded {
  		period = 0
  	}
  	// ensure the options and the pod are in sync
  	options.GracePeriodSeconds = &period
  	return true
  }
docs: // CheckGracefulDelete allows a pod to be gracefully deleted. It updates the DeleteOptions to
  // reflect the desired grace value.