code: func (m *ControllerRevisionControllerRefManager) ClaimControllerRevisions(histories []*apps.ControllerRevision) ([]*apps.ControllerRevision, error) {
  	var claimed []*apps.ControllerRevision
  	var errlist []error
  
  	match := func(obj metav1.Object) bool {
  		return m.Selector.Matches(labels.Set(obj.GetLabels()))
  	}
  	adopt := func(obj metav1.Object) error {
  		return m.AdoptControllerRevision(obj.(*apps.ControllerRevision))
  	}
  	release := func(obj metav1.Object) error {
  		return m.ReleaseControllerRevision(obj.(*apps.ControllerRevision))
  	}
  
  	for _, h := range histories {
  		ok, err := m.ClaimObject(h, match, adopt, release)
  		if err != nil {
  			errlist = append(errlist, err)
  			continue
  		}
  		if ok {
  			claimed = append(claimed, h)
  		}
  	}
  	return claimed, utilerrors.NewAggregate(errlist)
  }
docs: // ClaimControllerRevisions tries to take ownership of a list of ControllerRevisions.
  //
  // It will reconcile the following:
  //   * Adopt orphans if the selector matches.
  //   * Release owned objects if the selector no longer matches.
  //
  // A non-nil error is returned if some form of reconciliation was attempted and
  // failed. Usually, controllers should try again later in case reconciliation
  // is still needed.
  //
  // If the error is nil, either the reconciliation succeeded, or no
  // reconciliation was necessary. The list of ControllerRevisions that you now own is
  // returned.