mirror of
https://github.com/tailscale/tailscale.git
synced 2025-03-28 12:02:23 +00:00
Merge 2bf51e5bc5f1beb92255fe239b076103e67ec9c1 into 156cd53e7734407dc42e30af2f12cf6956cd9e24
This commit is contained in:
commit
8dafd6cfd9
File diff suppressed because it is too large
Load Diff
@ -35,6 +35,9 @@ import (
|
||||
|
||||
const tailscaleTunInterface = "tailscale0"
|
||||
|
||||
// Modified using a build flag to speed up tests.
|
||||
var testSleepDuration string
|
||||
|
||||
// This file contains functionality to run containerboot as a proxy that can
|
||||
// route cluster traffic to one or more tailnet targets, based on portmapping
|
||||
// rules read from a configfile. Currently (9/2024) this is only used for the
|
||||
@ -149,8 +152,13 @@ func (ep *egressProxy) configure(opts egressProxyRunOpts) {
|
||||
ep.podIPv4 = opts.podIPv4
|
||||
ep.tailnetAddrs = opts.tailnetAddrs
|
||||
ep.client = &http.Client{} // default HTTP client
|
||||
ep.shortSleep = time.Second
|
||||
ep.longSleep = time.Second * 10
|
||||
sleepDuration := time.Second
|
||||
if d, err := time.ParseDuration(testSleepDuration); err == nil && d > 0 {
|
||||
log.Printf("using test sleep duration %v", d)
|
||||
sleepDuration = d
|
||||
}
|
||||
ep.shortSleep = sleepDuration
|
||||
ep.longSleep = sleepDuration * 10
|
||||
}
|
||||
|
||||
// sync triggers an egress proxy config resync. The resync calculates the diff between config and status to determine if
|
||||
|
@ -38,11 +38,11 @@ func startTailscaled(ctx context.Context, cfg *settings) (*local.Client, *os.Pro
|
||||
}
|
||||
log.Printf("Starting tailscaled")
|
||||
if err := cmd.Start(); err != nil {
|
||||
return nil, nil, fmt.Errorf("starting tailscaled failed: %v", err)
|
||||
return nil, nil, fmt.Errorf("starting tailscaled failed: %w", err)
|
||||
}
|
||||
|
||||
// Wait for the socket file to appear, otherwise API ops will racily fail.
|
||||
log.Printf("Waiting for tailscaled socket")
|
||||
log.Printf("Waiting for tailscaled socket at %s", cfg.Socket)
|
||||
for {
|
||||
if ctx.Err() != nil {
|
||||
return nil, nil, errors.New("timed out waiting for tailscaled socket")
|
||||
|
Loading…
x
Reference in New Issue
Block a user