code: func (s *Scheduler) taskFitNode(ctx context.Context, t *api.Task, nodeID string) *api.Task {
  	nodeInfo, err := s.nodeSet.nodeInfo(nodeID)
  	if err != nil {
  		// node does not exist in set (it may have been deleted)
  		return nil
  	}
  	newT := *t
  	s.pipeline.SetTask(t)
  	if !s.pipeline.Process(&nodeInfo) {
  		// this node cannot accommodate this task
  		newT.Status.Timestamp = ptypes.MustTimestampProto(time.Now())
  		newT.Status.Err = s.pipeline.Explain()
  		s.allTasks[t.ID] = &newT
  
  		return &newT
  	}
  	newT.Status = api.TaskStatus{
  		State:     api.TaskStateAssigned,
  		Timestamp: ptypes.MustTimestampProto(time.Now()),
  		Message:   "scheduler confirmed task can run on preassigned node",
  	}
  	s.allTasks[t.ID] = &newT
  
  	if nodeInfo.addTask(&newT) {
  		s.nodeSet.updateNode(nodeInfo)
  	}
  	return &newT
  }
docs: // taskFitNode checks if a node has enough resources to accommodate a task.