code: func MatchLabels(selector Labels, target map[string]string) (bool, string, error) {
  	// Empty selector matches nothing.
  	if len(selector) == 0 {
  		return false, "no match, empty selector", nil
  	}
  
  	// *: * matches everything even empty target set.
  	selectorValues := selector[Wildcard]
  	if len(selectorValues) == 1 && selectorValues[0] == Wildcard {
  		return true, "matched", nil
  	}
  
  	// Perform full match.
  	for key, selectorValues := range selector {
  		targetVal, hasKey := target[key]
  
  		if !hasKey {
  			return false, fmt.Sprintf("no key match: '%v'", key), nil
  		}
  
  		if !utils.SliceContainsStr(selectorValues, Wildcard) {
  			result, err := utils.SliceMatchesRegex(targetVal, selectorValues)
  			if err != nil {
  				return false, "", trace.Wrap(err)
  			} else if !result {
  				return false, fmt.Sprintf("no value match: got '%v' want: '%v'", targetVal, selectorValues), nil
  			}
  		}
  	}
  
  	return true, "matched", nil
  }
docs: // MatchLabels matches selector against target. Empty selector matches
  // nothing, wildcard matches everything.