code: func (m *managerImpl) Admit(attrs *lifecycle.PodAdmitAttributes) lifecycle.PodAdmitResult {
  	m.RLock()
  	defer m.RUnlock()
  	if len(m.nodeConditions) == 0 {
  		return lifecycle.PodAdmitResult{Admit: true}
  	}
  	// Admit Critical pods even under resource pressure since they are required for system stability.
  	// https://github.com/kubernetes/kubernetes/issues/40573 has more details.
  	if kubelettypes.IsCriticalPod(attrs.Pod) {
  		return lifecycle.PodAdmitResult{Admit: true}
  	}
  	// the node has memory pressure, admit if not best-effort
  	if hasNodeCondition(m.nodeConditions, v1.NodeMemoryPressure) {
  		notBestEffort := v1.PodQOSBestEffort != v1qos.GetPodQOS(attrs.Pod)
  		if notBestEffort {
  			return lifecycle.PodAdmitResult{Admit: true}
  		}
  
  		// When node has memory pressure and TaintNodesByCondition is enabled, check BestEffort Pod's toleration:
  		// admit it if tolerates memory pressure taint, fail for other tolerations, e.g. OutOfDisk.
  		if utilfeature.DefaultFeatureGate.Enabled(features.TaintNodesByCondition) &&
  			v1helper.TolerationsTolerateTaint(attrs.Pod.Spec.Tolerations, &v1.Taint{
  				Key:    schedulerapi.TaintNodeMemoryPressure,
  				Effect: v1.TaintEffectNoSchedule,
  			}) {
  			return lifecycle.PodAdmitResult{Admit: true}
  		}
  	}
  
  	// reject pods when under memory pressure (if pod is best effort), or if under disk pressure.
  	klog.Warningf("Failed to admit pod %s - node has conditions: %v", format.Pod(attrs.Pod), m.nodeConditions)
  	return lifecycle.PodAdmitResult{
  		Admit:   false,
  		Reason:  Reason,
  		Message: fmt.Sprintf(nodeConditionMessageFmt, m.nodeConditions),
  	}
  }
docs: // Admit rejects a pod if its not safe to admit for node stability.