code: func (p *Plugin) Admit(attributes admission.Attributes, o admission.ObjectInterfaces) (err error) {
  	if attributes.GetResource().GroupResource() != api.Resource("pods") {
  		return nil
  	}
  
  	if len(attributes.GetSubresource()) > 0 {
  		// only run the checks below on pods proper and not subresources
  		return nil
  	}
  
  	pod, ok := attributes.GetObject().(*api.Pod)
  	if !ok {
  		return errors.NewBadRequest(fmt.Sprintf("expected *api.Pod but got %T", attributes.GetObject()))
  	}
  
  	tolerations := pod.Spec.Tolerations
  
  	toleratesNodeNotReady := false
  	toleratesNodeUnreachable := false
  	for _, toleration := range tolerations {
  		if (toleration.Key == schedulerapi.TaintNodeNotReady || len(toleration.Key) == 0) &&
  			(toleration.Effect == api.TaintEffectNoExecute || len(toleration.Effect) == 0) {
  			toleratesNodeNotReady = true
  		}
  
  		if (toleration.Key == schedulerapi.TaintNodeUnreachable || len(toleration.Key) == 0) &&
  			(toleration.Effect == api.TaintEffectNoExecute || len(toleration.Effect) == 0) {
  			toleratesNodeUnreachable = true
  		}
  	}
  
  	if !toleratesNodeNotReady {
  		pod.Spec.Tolerations = append(pod.Spec.Tolerations, notReadyToleration)
  	}
  
  	if !toleratesNodeUnreachable {
  		pod.Spec.Tolerations = append(pod.Spec.Tolerations, unreachableToleration)
  	}
  
  	return nil
  }
docs: // Admit makes an admission decision based on the request attributes