It was recently discovered that VMs that are part of managed instance groups (i.e., load balanced) are not producing hopannotation2 or scamper1 data from the traceroute-caller container. This is because the socket information provided by tcp-info specifies the load balancer IP address, and traceroute-caller was unable to identify the address as "local", so would refuse to run traces, exiting with an error.
This PR adds a new loadbalanerIPs() function which will extract loadbalancer IP addresses, if any, from machine metadata (/var/local/metadata) mounted into the container at /metadata. It adds any loadbalancer IPs to the slice handler.LocalIPs so that it can associate LB IP addresses as local, allowing it to determine the proper destination for a traceroute.
I made one other small change, which was to change the type of Handler.LocalIPs from []*net.IP to []net.IP. I found the slice-of-pointers hard to work with, and unless there was some reason that was being done that I'm not aware of, it is apparently generally bad form in Go to create slices of pointers, since slices are passed around by reference by default anyway.
I also took the opportunity to update Go to v1.21 (maybe I should have gone to v1.22?)
It was recently discovered that VMs that are part of managed instance groups (i.e., load balanced) are not producing hopannotation2 or scamper1 data from the traceroute-caller container. This is because the socket information provided by tcp-info specifies the load balancer IP address, and traceroute-caller was unable to identify the address as "local", so would refuse to run traces, exiting with an error.
This PR adds a new
loadbalanerIPs()
function which will extract loadbalancer IP addresses, if any, from machine metadata (/var/local/metadata) mounted into the container at /metadata. It adds any loadbalancer IPs to the slicehandler.LocalIPs
so that it can associate LB IP addresses as local, allowing it to determine the proper destination for a traceroute.I made one other small change, which was to change the type of
Handler.LocalIPs
from[]*net.IP
to[]net.IP
. I found the slice-of-pointers hard to work with, and unless there was some reason that was being done that I'm not aware of, it is apparently generally bad form in Go to create slices of pointers, since slices are passed around by reference by default anyway.I also took the opportunity to update Go to v1.21 (maybe I should have gone to v1.22?)
This change is![Reviewable](https://reviewable.io/review_button.svg)