code: func FindNewReplicaSet(deployment *apps.Deployment, rsList []*apps.ReplicaSet) *apps.ReplicaSet {
  	sort.Sort(controller.ReplicaSetsByCreationTimestamp(rsList))
  	for i := range rsList {
  		if EqualIgnoreHash(&rsList[i].Spec.Template, &deployment.Spec.Template) {
  			// In rare cases, such as after cluster upgrades, Deployment may end up with
  			// having more than one new ReplicaSets that have the same template as its template,
  			// see https://github.com/kubernetes/kubernetes/issues/40415
  			// We deterministically choose the oldest new ReplicaSet.
  			return rsList[i]
  		}
  	}
  	// new ReplicaSet does not exist.
  	return nil
  }
docs: // FindNewReplicaSet returns the new RS this given deployment targets (the one with the same pod template).