code: func (s *ServiceAffinity) serviceAffinityMetadataProducer(pm *predicateMetadata) {
  	if pm.pod == nil {
  		klog.Errorf("Cannot precompute service affinity, a pod is required to calculate service affinity.")
  		return
  	}
  	pm.serviceAffinityInUse = true
  	var err error
  	// Store services which match the pod.
  	pm.serviceAffinityMatchingPodServices, err = s.serviceLister.GetPodServices(pm.pod)
  	if err != nil {
  		klog.Errorf("Error precomputing service affinity: could not list services: %v", err)
  	}
  	selector := CreateSelectorFromLabels(pm.pod.Labels)
  	allMatches, err := s.podLister.List(selector)
  	if err != nil {
  		klog.Errorf("Error precomputing service affinity: could not list pods: %v", err)
  	}
  
  	// consider only the pods that belong to the same namespace
  	pm.serviceAffinityMatchingPodList = FilterPodsByNamespace(allMatches, pm.pod.Namespace)
  }
docs: // serviceAffinityMetadataProducer should be run once by the scheduler before looping through the Predicate.  It is a helper function that
  // only should be referenced by NewServiceAffinityPredicate.