code: func (n *NodeInfo) AddPod(pod *v1.Pod) {
  	res, non0CPU, non0Mem := calculateResource(pod)
  	n.requestedResource.MilliCPU += res.MilliCPU
  	n.requestedResource.Memory += res.Memory
  	n.requestedResource.EphemeralStorage += res.EphemeralStorage
  	if n.requestedResource.ScalarResources == nil && len(res.ScalarResources) > 0 {
  		n.requestedResource.ScalarResources = map[v1.ResourceName]int64{}
  	}
  	for rName, rQuant := range res.ScalarResources {
  		n.requestedResource.ScalarResources[rName] += rQuant
  	}
  	n.nonzeroRequest.MilliCPU += non0CPU
  	n.nonzeroRequest.Memory += non0Mem
  	n.pods = append(n.pods, pod)
  	if hasPodAffinityConstraints(pod) {
  		n.podsWithAffinity = append(n.podsWithAffinity, pod)
  	}
  
  	// Consume ports when pods added.
  	n.UpdateUsedPorts(pod, true)
  
  	n.generation = nextGeneration()
  }
docs: // AddPod adds pod information to this NodeInfo.