const aggregatedDiscoveryTimeout … // findServicePort finds the service port by name or numerically. func findServicePort(svc *v1.Service, port int32) (*v1.ServicePort, error) { … } // ResolveEndpoint returns a URL to which one can send traffic for the specified service. func ResolveEndpoint(services listersv1.ServiceLister, endpoints listersv1.EndpointsLister, namespace, id string, port int32) (*url.URL, error) { … } func ResolveCluster(services listersv1.ServiceLister, namespace, id string, port int32) (*url.URL, error) { … } // NewRequestForProxy returns a shallow copy of the original request with a context that may include a timeout for discovery requests func NewRequestForProxy(location *url.URL, req *http.Request) (*http.Request, context.CancelFunc) { … }