code: func filterPodPresets(list []*settingsv1alpha1.PodPreset, pod *api.Pod) ([]*settingsv1alpha1.PodPreset, error) {
  	var matchingPPs []*settingsv1alpha1.PodPreset
  
  	for _, pp := range list {
  		selector, err := metav1.LabelSelectorAsSelector(&pp.Spec.Selector)
  		if err != nil {
  			return nil, fmt.Errorf("label selector conversion failed: %v for selector: %v", pp.Spec.Selector, err)
  		}
  
  		// check if the pod labels match the selector
  		if !selector.Matches(labels.Set(pod.Labels)) {
  			continue
  		}
  		klog.V(4).Infof("PodPreset %s matches pod %s labels", pp.GetName(), pod.GetName())
  		matchingPPs = append(matchingPPs, pp)
  	}
  	return matchingPPs, nil
  }
docs: // filterPodPresets returns list of PodPresets which match given Pod.