mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-21 18:42:36 +00:00
prober: support creating multiple probes in ForEachAddr
So that we can e.g. check TLS on multiple ports for a given IP. Updates tailscale/corp#16367 Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: I81d840a4c88138de1cbb2032b917741c009470e6
This commit is contained in:
@@ -48,7 +48,7 @@ func TestForEachAddr(t *testing.T) {
|
||||
mu sync.Mutex // protects following
|
||||
registered []netip.Addr
|
||||
)
|
||||
newProbe := func(addr netip.Addr) *Probe {
|
||||
newProbe := func(addr netip.Addr) []*Probe {
|
||||
// Called to register a new prober
|
||||
t.Logf("called to register new probe for %v", addr)
|
||||
|
||||
@@ -57,9 +57,10 @@ func TestForEachAddr(t *testing.T) {
|
||||
registered = append(registered, addr)
|
||||
|
||||
// Return a probe that does nothing; we don't care about what this does.
|
||||
return p.Run(fmt.Sprintf("website/%s", addr), probeInterval, nil, func(_ context.Context) error {
|
||||
probe := p.Run(fmt.Sprintf("website/%s", addr), probeInterval, nil, func(_ context.Context) error {
|
||||
return nil
|
||||
})
|
||||
return []*Probe{probe}
|
||||
}
|
||||
|
||||
fep := makeForEachAddr("tailscale.com", newProbe, opts)
|
||||
|
Reference in New Issue
Block a user