code: func (dc *DeploymentController) getReplicaFailures(allRSs []*apps.ReplicaSet, newRS *apps.ReplicaSet) []apps.DeploymentCondition {
  	var conditions []apps.DeploymentCondition
  	if newRS != nil {
  		for _, c := range newRS.Status.Conditions {
  			if c.Type != apps.ReplicaSetReplicaFailure {
  				continue
  			}
  			conditions = append(conditions, util.ReplicaSetToDeploymentCondition(c))
  		}
  	}
  
  	// Return failures for the new replica set over failures from old replica sets.
  	if len(conditions) > 0 {
  		return conditions
  	}
  
  	for i := range allRSs {
  		rs := allRSs[i]
  		if rs == nil {
  			continue
  		}
  
  		for _, c := range rs.Status.Conditions {
  			if c.Type != apps.ReplicaSetReplicaFailure {
  				continue
  			}
  			conditions = append(conditions, util.ReplicaSetToDeploymentCondition(c))
  		}
  	}
  	return conditions
  }
docs: // getReplicaFailures will convert replica failure conditions from replica sets
  // to deployment conditions.