code: func checkEndpointSubsetFormat(e *corev1.Endpoints, ip string, ports []corev1.EndpointPort, count int, reconcilePorts bool) (formatCorrect bool, ipCorrect bool, portsCorrect bool) {
  	if len(e.Subsets) != 1 {
  		return false, false, false
  	}
  	sub := &e.Subsets[0]
  	portsCorrect = true
  	if reconcilePorts {
  		if len(sub.Ports) != len(ports) {
  			portsCorrect = false
  		}
  		for i, port := range ports {
  			if len(sub.Ports) <= i || port != sub.Ports[i] {
  				portsCorrect = false
  				break
  			}
  		}
  	}
  	for _, addr := range sub.Addresses {
  		if addr.IP == ip {
  			ipCorrect = len(sub.Addresses) <= count
  			break
  		}
  	}
  	return true, ipCorrect, portsCorrect
  }
docs: // Determine if the endpoint is in the format ReconcileEndpoints expects.
  //
  // Return values:
  // * formatCorrect is true if exactly one subset is found.
  // * ipCorrect is true when current master's IP is found and the number
  //     of addresses is less than or equal to the master count.
  // * portsCorrect is true when endpoint ports exactly match provided ports.
  //     portsCorrect is only evaluated when reconcilePorts is set to true.