linkerd2/controller/api/destination/watcher
Kevin Leimkuhler e65f216d52
Add endpoint to GetProfile response (#5227)
Context: #5209

This updates the destination service to set the `Endpoint` field in `GetProfile`
responses.

The `Endpoint` field is only set if the IP maps to a Pod--not a Service.

Additionally in this scenario, the default Service Profile is used as the base
profile so no other significant fields are set.

### Examples

```
# GetProfile for an IP that maps to a Service
❯ go run controller/script/destination-client/main.go -method getProfile -path 10.43.222.0:9090
INFO[0000] fully_qualified_name:"linkerd-prometheus.linkerd.svc.cluster.local"  retry_budget:{retry_ratio:0.2  min_retries_per_second:10  ttl:{seconds:10}}  dst_overrides:{authority:"linkerd-prometheus.linkerd.svc.cluster.local.:9090"  weight:10000}
```

Before:

```
# GetProfile for an IP that maps to a Pod
❯ go run controller/script/destination-client/main.go -method getProfile -path 10.42.0.20
INFO[0000] retry_budget:{retry_ratio:0.2 min_retries_per_second:10 ttl:{seconds:10}}
```


After:

```
# GetProfile for an IP that maps to a Pod
❯ go run controller/script/destination-client/main.go -method getProfile -path 10.42.0.20
INFO[0000] retry_budget:{retry_ratio:0.2  min_retries_per_second:10  ttl:{seconds:10}}  endpoint:{addr:{ip:{ipv4:170524692}}  weight:10000  metric_labels:{key:"control_plane_ns"  value:"linkerd"}  metric_labels:{key:"deployment"  value:"fast-1"}  metric_labels:{key:"pod"  value:"fast-1-5cc87f64bc-9hx7h"}  metric_labels:{key:"pod_template_hash"  value:"5cc87f64bc"}  metric_labels:{key:"serviceaccount"  value:"default"}  tls_identity:{dns_like_identity:{name:"default.default.serviceaccount.identity.linkerd.cluster.local"}}  protocol_hint:{h2:{}}}
```

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2020-11-18 15:41:25 -05:00
..
endpoints_watcher.go Bump k8s client-go to v0.19.2 (#5002) 2020-09-28 12:45:18 -05:00
endpoints_watcher_test.go Spelling (#4872) 2020-08-12 21:59:50 -07:00
ip_watcher.go Add endpoint to GetProfile response (#5227) 2020-11-18 15:41:25 -05:00
ip_watcher_test.go Add endpoint to GetProfile response (#5227) 2020-11-18 15:41:25 -05:00
k8s.go Return invalid argument for external name services (#3120) 2019-07-29 16:31:22 -07:00
profile_watcher.go Ensure we get the correct type out of Informer Deletion events (#4034) 2020-02-15 10:15:24 +02:00
profile_watcher_test.go Service Mirroring Component (#4028) 2020-03-02 21:16:08 +02:00
prometheus.go Add support for stateful sets (#3113) 2019-07-24 14:09:46 -07:00
test_util.go Ensure we get the correct type out of Informer Deletion events (#4034) 2020-02-15 10:15:24 +02:00
traffic_split_watcher.go Upgrade to client-go 0.17.4 and smi-sdk-go 0.3.0 (#4221) 2020-04-01 10:07:23 -07:00
traffic_split_watcher_test.go Upgrade to client-go 0.17.4 and smi-sdk-go 0.3.0 (#4221) 2020-04-01 10:07:23 -07:00