linkerd2/controller
Alejandro Pedraza 52ae875e9d
Fixes HostPort mapping lookup that was generating a false warning (#9918)
When performing the HostPort mapping introduced in #9819, the `containsIP` iterates through the pod IPs searching for a match against `targetIP` using `ip.String()`, but that returns something like `&PodIP{IP: xxx}`. Fixed that to just use `ip.IP`, and also completed the text fixtures to include both `PodIP` and `PodIPs` in the pods manifests.

Note this wasn't affecting the end result, it was just producing an extra warning as shown below, that this change eliminates:

```bash
$ go test -v ./controller/api/destination/... -run TestGetProfiles
=== RUN   TestGetProfiles
...
=== RUN   TestGetProfiles/Return_profile_with_endpoint_when_using_pod_DNS
time="2022-11-29T09:38:48-05:00" level=info msg="waiting for caches to sync"
time="2022-11-29T09:38:49-05:00" level=info msg="caches synced"
time="2022-11-29T09:38:49-05:00" level=warning msg="unable to find container port as host (172.17.13.15) matches neither PodIP nor HostIP (&Pod{ObjectMeta:{pod-0  ns    0 0001-01-01 00:00:00 +0000 UTC <nil> <nil> map[linkerd.io/control-plane-ns:linkerd] map[] [] [] []},Spec:PodSpec{Volumes:[]Volume{},Containers:[]Container{},RestartPolicy:,TerminationGracePeriodSeconds:nil,ActiveDeadlineSeconds:nil,DNSPolicy:,NodeSelector:map[string]string{},ServiceAccountName:,DeprecatedServiceAccount:,NodeName:,HostNetwork:false,HostPID:false,HostIPC:false,SecurityContext:nil,ImagePullSecrets:[]LocalObjectReference{},Hostname:,Subdomain:,Affinity:nil,SchedulerName:,InitContainers:[]Container{},AutomountServiceAccountToken:nil,Tolerations:[]Toleration{},HostAliases:[]HostAlias{},PriorityClassName:,Priority:nil,DNSConfig:nil,ShareProcessNamespace:nil,ReadinessGates:[]PodReadinessGate{},RuntimeClassName:nil,EnableServiceLinks:nil,PreemptionPolicy:nil,Overhead:ResourceList{},TopologySpreadConstraints:[]TopologySpreadConstraint{},EphemeralContainers:[]EphemeralContainer{},SetHostnameAsFQDN:nil,OS:nil,HostUsers:nil,},Status:PodStatus{Phase:Running,Conditions:[]PodCondition{},Message:,Reason:,HostIP:,PodIP:172.17.13.15,StartTime:<nil>,ContainerStatuses:[]ContainerStatus{},QOSClass:,InitContainerStatuses:[]ContainerStatus{},NominatedNodeName:,PodIPs:[]PodIP{},EphemeralContainerStatuses:[]ContainerStatus{},},})" test=TestGetProfiles/Return_profile_with_endpoint_when_using_pod_DNS
```
2022-11-29 16:33:31 -05:00
..
api Fixes HostPort mapping lookup that was generating a false warning (#9918) 2022-11-29 16:33:31 -05:00
cmd Replace usage of io/ioutil package (#9613) 2022-10-13 12:10:58 -05:00
gen Fix policy API json mapping (#9329) 2022-09-12 08:07:36 -07:00
heartbeat Use go-test/deep for comparisons in tests (#8427) 2022-05-05 09:31:07 -07:00
identity core: use serviceAccountToken volume for pod authentication (#7117) 2021-11-03 02:03:39 +05:30
k8s Use metadata API in the proxy and tap injectors (#9650) 2022-11-16 09:21:39 -05:00
proxy-injector edge-22.11.3 change notes (#9884) 2022-11-23 14:35:20 -05:00
script Enable gocritic linting (#7906) 2022-02-17 22:45:25 +00:00
sp-validator Use metadata API in the proxy and tap injectors (#9650) 2022-11-16 09:21:39 -05:00
webhook Use metadata API in the proxy and tap injectors (#9650) 2022-11-16 09:21:39 -05:00
Dockerfile Update Go to 1.18 (#9019) 2022-07-27 16:10:39 -07:00