code: func checkEndpointSubsetFormatWithLease(e *corev1.Endpoints, expectedIPs []string, ports []corev1.EndpointPort, reconcilePorts bool) (formatCorrect bool, ipsCorrect 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
  		} else {
  			for i, port := range ports {
  				if port != sub.Ports[i] {
  					portsCorrect = false
  					break
  				}
  			}
  		}
  	}
  
  	ipsCorrect = true
  	if len(sub.Addresses) != len(expectedIPs) {
  		ipsCorrect = false
  	} else {
  		// check the actual content of the addresses
  		// present addrs is used as a set (the keys) and to indicate if a
  		// value was already found (the values)
  		presentAddrs := make(map[string]bool, len(expectedIPs))
  		for _, ip := range expectedIPs {
  			presentAddrs[ip] = false
  		}
  
  		// uniqueness is assumed amongst all Addresses.
  		for _, addr := range sub.Addresses {
  			if alreadySeen, ok := presentAddrs[addr.IP]; alreadySeen || !ok {
  				ipsCorrect = false
  				break
  			}
  
  			presentAddrs[addr.IP] = true
  		}
  	}
  
  	return true, ipsCorrect, portsCorrect
  }
docs: // checkEndpointSubsetFormatWithLease determines if the endpoint is in the
  // format ReconcileEndpoints expects when the controller is using leases.
  //
  // Return values:
  // * formatCorrect is true if exactly one subset is found.
  // * ipsCorrect when the addresses in the endpoints match the expected addresses list
  // * portsCorrect is true when endpoint ports exactly match provided ports.
  //     portsCorrect is only evaluated when reconcilePorts is set to true.