mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-02 10:01:57 +00:00
all: use new LocalAPI client package location
It was moved in f57fa3cbc3.
Updates tailscale/corp#22748
Change-Id: I19f965e6bded1d4c919310aa5b864f2de0cd6220
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
8ecce0e98d
commit
05ac21ebe4
@@ -26,6 +26,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"tailscale.com/client/local"
|
||||
"tailscale.com/client/tailscale"
|
||||
"tailscale.com/control/controlclient"
|
||||
"tailscale.com/envknob"
|
||||
@@ -135,11 +136,11 @@ type Server struct {
|
||||
hostname string
|
||||
shutdownCtx context.Context
|
||||
shutdownCancel context.CancelFunc
|
||||
proxyCred string // SOCKS5 proxy auth for loopbackListener
|
||||
localAPICred string // basic auth password for loopbackListener
|
||||
loopbackListener net.Listener // optional loopback for localapi and proxies
|
||||
localAPIListener net.Listener // in-memory, used by localClient
|
||||
localClient *tailscale.LocalClient // in-memory
|
||||
proxyCred string // SOCKS5 proxy auth for loopbackListener
|
||||
localAPICred string // basic auth password for loopbackListener
|
||||
loopbackListener net.Listener // optional loopback for localapi and proxies
|
||||
localAPIListener net.Listener // in-memory, used by localClient
|
||||
localClient *local.Client // in-memory
|
||||
localAPIServer *http.Server
|
||||
logbuffer *filch.Filch
|
||||
logtail *logtail.Logger
|
||||
@@ -222,7 +223,7 @@ func (s *Server) HTTPClient() *http.Client {
|
||||
//
|
||||
// It will start the server if it has not been started yet. If the server's
|
||||
// already been started successfully, it doesn't return an error.
|
||||
func (s *Server) LocalClient() (*tailscale.LocalClient, error) {
|
||||
func (s *Server) LocalClient() (*local.Client, error) {
|
||||
if err := s.Start(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -676,7 +677,7 @@ func (s *Server) start() (reterr error) {
|
||||
// nettest.Listen provides a in-memory pipe based implementation for net.Conn.
|
||||
lal := memnet.Listen("local-tailscaled.sock:80")
|
||||
s.localAPIListener = lal
|
||||
s.localClient = &tailscale.LocalClient{Dial: lal.Dial}
|
||||
s.localClient = &local.Client{Dial: lal.Dial}
|
||||
s.localAPIServer = &http.Server{Handler: lah}
|
||||
s.lb.ConfigureWebClient(s.localClient)
|
||||
go func() {
|
||||
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
dto "github.com/prometheus/client_model/go"
|
||||
"github.com/prometheus/common/expfmt"
|
||||
"golang.org/x/net/proxy"
|
||||
"tailscale.com/client/tailscale"
|
||||
"tailscale.com/client/local"
|
||||
"tailscale.com/cmd/testwrapper/flakytest"
|
||||
"tailscale.com/ipn"
|
||||
"tailscale.com/ipn/store/mem"
|
||||
@@ -1273,7 +1273,7 @@ func waitForCondition(t *testing.T, msg string, waitTime time.Duration, f func()
|
||||
}
|
||||
|
||||
// mustDirect ensures there is a direct connection between LocalClient 1 and 2
|
||||
func mustDirect(t *testing.T, logf logger.Logf, lc1, lc2 *tailscale.LocalClient) {
|
||||
func mustDirect(t *testing.T, logf logger.Logf, lc1, lc2 *local.Client) {
|
||||
t.Helper()
|
||||
lastLog := time.Now().Add(-time.Minute)
|
||||
// See https://github.com/tailscale/tailscale/issues/654
|
||||
|
||||
Reference in New Issue
Block a user