code: func (m *PodControllerRefManager) ClaimPods(pods []*v1.Pod, filters ...func(*v1.Pod) bool) ([]*v1.Pod, error) {
  	var claimed []*v1.Pod
  	var errlist []error
  
  	match := func(obj metav1.Object) bool {
  		pod := obj.(*v1.Pod)
  		// Check selector first so filters only run on potentially matching Pods.
  		if !m.Selector.Matches(labels.Set(pod.Labels)) {
  			return false
  		}
  		for _, filter := range filters {
  			if !filter(pod) {
  				return false
  			}
  		}
  		return true
  	}
  	adopt := func(obj metav1.Object) error {
  		return m.AdoptPod(obj.(*v1.Pod))
  	}
  	release := func(obj metav1.Object) error {
  		return m.ReleasePod(obj.(*v1.Pod))
  	}
  
  	for _, pod := range pods {
  		ok, err := m.ClaimObject(pod, match, adopt, release)
  		if err != nil {
  			errlist = append(errlist, err)
  			continue
  		}
  		if ok {
  			claimed = append(claimed, pod)
  		}
  	}
  	return claimed, utilerrors.NewAggregate(errlist)
  }
docs: // ClaimPods tries to take ownership of a list of Pods.
  //
  // It will reconcile the following:
  //   * Adopt orphans if the selector matches.
  //   * Release owned objects if the selector no longer matches.
  //
  // Optional: If one or more filters are specified, a Pod will only be claimed if
  // all filters return true.
  //
  // 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 Pods that you now own is returned.