linkerd2/controller/destination
Eliza Weisman 56681015ae
Fix Destination returning no endpoints for single unnamed container port (#1420)
Fixes #1405.

According to the Kubernetes Endpoints API documentation, the `name`
field in the `EndpointPort` response object is "Optional if only one
port is defined". (see
https://v1-9.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.9/#endpointport-v1-core)
However, when the Destination service an endpoints response for a
service with a named target port, it expects the ports in the endpoints
response to have the same name as the target port in the service. 

When a user creates a `NodePort` service with an unnamed port that
targets a named container port, this behaviour results in Linkerd
failing to route to that service by hostname. Without Linkerd injected,
the hostname is still reachable. 

This branch fixes this issue by changing the `endpointsToAddresses`
function in `endpoints_watcher.go` to handle the case when an endpoints
response contains only a single unnamed port.

I've manually verified that this fixes the issue described in #1405.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-08-08 13:01:53 -07:00
..
client.go Migrate build infrastructure to linkerd2 (#1298) 2018-07-09 15:38:38 -07:00
endpoints_watcher.go Fix Destination returning no endpoints for single unnamed container port (#1420) 2018-08-08 13:01:53 -07:00
endpoints_watcher_test.go Fix Destination returning no endpoints for single unnamed container port (#1420) 2018-08-08 13:01:53 -07:00
k8s_resolver.go Migrate build infrastructure to linkerd2 (#1298) 2018-07-09 15:38:38 -07:00
k8s_resolver_test.go dest service: close open streams on shutdown (#1156) 2018-06-19 16:00:56 -07:00
listener.go Update prometheus to only scrape proxies in the same mesh (#1402) 2018-08-06 12:05:55 -07:00
listener_test.go Update prometheus labels to match k8s resource names (#1355) 2018-07-23 15:45:05 -07:00
resolver.go dst svc: use shared informer instead of custom endpoints informer (#1079) 2018-06-13 11:11:57 -07:00
server.go Ensure destination service always sends pod metadata (#1291) 2018-07-10 15:08:59 -07:00
server_test.go Migrate build infrastructure to linkerd2 (#1298) 2018-07-09 15:38:38 -07:00
test_helper.go Ensure destination service always sends pod metadata (#1291) 2018-07-10 15:08:59 -07:00