diff --git a/client/local/local.go b/client/local/local.go index a606fbdf3..63300c5c0 100644 --- a/client/local/local.go +++ b/client/local/local.go @@ -288,13 +288,6 @@ func (lc *Client) get200(ctx context.Context, path string) ([]byte, error) { return lc.send(ctx, "GET", path, 200, nil) } -// WhoIs returns the owner of the remoteAddr, which must be an IP or IP:port. -// -// Deprecated: use [Client.WhoIs]. -func WhoIs(ctx context.Context, remoteAddr string) (*apitype.WhoIsResponse, error) { - return defaultClient.WhoIs(ctx, remoteAddr) -} - func decodeJSON[T any](b []byte) (ret T, err error) { if err := json.Unmarshal(b, &ret); err != nil { var zero T diff --git a/client/tailscale/localclient_aliases.go b/client/tailscale/localclient_aliases.go deleted file mode 100644 index e3492e841..000000000 --- a/client/tailscale/localclient_aliases.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Tailscale Inc & AUTHORS -// SPDX-License-Identifier: BSD-3-Clause - -package tailscale - -import ( - "context" - - "tailscale.com/client/local" - "tailscale.com/client/tailscale/apitype" - "tailscale.com/ipn/ipnstate" -) - -// ErrPeerNotFound is an alias for [tailscale.com/client/local.ErrPeerNotFound]. -// -// Deprecated: import [tailscale.com/client/local] instead. -var ErrPeerNotFound = local.ErrPeerNotFound - -// LocalClient is an alias for [tailscale.com/client/local.Client]. -// -// Deprecated: import [tailscale.com/client/local] instead. -type LocalClient = local.Client - -// IPNBusWatcher is an alias for [tailscale.com/client/local.IPNBusWatcher]. -// -// Deprecated: import [tailscale.com/client/local] instead. -type IPNBusWatcher = local.IPNBusWatcher - -// BugReportOpts is an alias for [tailscale.com/client/local.BugReportOpts]. -// -// Deprecated: import [tailscale.com/client/local] instead. -type BugReportOpts = local.BugReportOpts - -// PingOpts is an alias for [tailscale.com/client/local.PingOpts]. -// -// Deprecated: import [tailscale.com/client/local] instead. -type PingOpts = local.PingOpts - -// SetVersionMismatchHandler is an alias for [tailscale.com/client/local.SetVersionMismatchHandler]. -// -// Deprecated: import [tailscale.com/client/local] instead. -func SetVersionMismatchHandler(f func(clientVer, serverVer string)) { - local.SetVersionMismatchHandler(f) -} - -// IsAccessDeniedError is an alias for [tailscale.com/client/local.IsAccessDeniedError]. -// -// Deprecated: import [tailscale.com/client/local] instead. -func IsAccessDeniedError(err error) bool { - return local.IsAccessDeniedError(err) -} - -// IsPreconditionsFailedError is an alias for [tailscale.com/client/local.IsPreconditionsFailedError]. -// -// Deprecated: import [tailscale.com/client/local] instead. -func IsPreconditionsFailedError(err error) bool { - return local.IsPreconditionsFailedError(err) -} - -// WhoIs is an alias for [tailscale.com/client/local.WhoIs]. -// -// Deprecated: import [tailscale.com/client/local] instead and use [local.Client.WhoIs]. -func WhoIs(ctx context.Context, remoteAddr string) (*apitype.WhoIsResponse, error) { - return local.WhoIs(ctx, remoteAddr) -} - -// Status is an alias for [tailscale.com/client/local.Status]. -// -// Deprecated: import [tailscale.com/client/local] instead. -func Status(ctx context.Context) (*ipnstate.Status, error) { - return local.Status(ctx) -} - -// StatusWithoutPeers is an alias for [tailscale.com/client/local.StatusWithoutPeers]. -// -// Deprecated: import [tailscale.com/client/local] instead. -func StatusWithoutPeers(ctx context.Context) (*ipnstate.Status, error) { - return local.StatusWithoutPeers(ctx) -} diff --git a/cmd/nginx-auth/nginx-auth.go b/cmd/nginx-auth/nginx-auth.go index 09da74da1..04bdaee6a 100644 --- a/cmd/nginx-auth/nginx-auth.go +++ b/cmd/nginx-auth/nginx-auth.go @@ -21,7 +21,7 @@ import ( "strings" "github.com/coreos/go-systemd/activation" - "tailscale.com/client/tailscale" + "tailscale.com/client/local" ) var ( @@ -49,7 +49,7 @@ func main() { return } - info, err := tailscale.WhoIs(r.Context(), remoteAddr.String()) + info, err := new(local.Client).WhoIs(r.Context(), remoteAddr.String()) if err != nil { w.WriteHeader(http.StatusUnauthorized) log.Printf("can't look up %s: %v", remoteAddr, err) diff --git a/tsconsensus/tsconsensus_test.go b/tsconsensus/tsconsensus_test.go index 3b51a093f..a957b6f31 100644 --- a/tsconsensus/tsconsensus_test.go +++ b/tsconsensus/tsconsensus_test.go @@ -26,7 +26,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/hashicorp/go-hclog" "github.com/hashicorp/raft" - "tailscale.com/client/tailscale" + "tailscale.com/client/local" "tailscale.com/cmd/testwrapper/flakytest" "tailscale.com/ipn/store/mem" "tailscale.com/net/netns" @@ -296,7 +296,7 @@ func startNodesAndWaitForPeerStatus(t testing.TB, ctx context.Context, clusterTa t.Helper() ps := make([]*participant, nNodes) keysToTag := make([]key.NodePublic, nNodes) - localClients := make([]*tailscale.LocalClient, nNodes) + localClients := make([]*local.Client, nNodes) control, controlURL := startControl(t) for i := 0; i < nNodes; i++ { ts, key, _ := startNode(t, ctx, controlURL, fmt.Sprintf("node %d", i)) diff --git a/tstest/integration/integration_test.go b/tstest/integration/integration_test.go index b282adcf8..5c14e2cb4 100644 --- a/tstest/integration/integration_test.go +++ b/tstest/integration/integration_test.go @@ -30,7 +30,6 @@ import ( "github.com/miekg/dns" "go4.org/mem" "tailscale.com/client/local" - "tailscale.com/client/tailscale" "tailscale.com/clientupdate" "tailscale.com/cmd/testwrapper/flakytest" "tailscale.com/hostinfo" @@ -800,7 +799,7 @@ func TestClientSideJailing(t *testing.T) { if err != nil { t.Fatal(err) } - waitPeerIsJailed := func(t *testing.T, b *tailscale.IPNBusWatcher, jailed bool) { + waitPeerIsJailed := func(t *testing.T, b *local.IPNBusWatcher, jailed bool) { t.Helper() for { n, err := b.Next() diff --git a/tstest/integration/nat/nat_test.go b/tstest/integration/nat/nat_test.go index 15f126985..ff703f30c 100644 --- a/tstest/integration/nat/nat_test.go +++ b/tstest/integration/nat/nat_test.go @@ -24,7 +24,7 @@ import ( "golang.org/x/mod/modfile" "golang.org/x/sync/errgroup" - "tailscale.com/client/tailscale" + "tailscale.com/client/local" "tailscale.com/ipn/ipnstate" "tailscale.com/syncs" "tailscale.com/tailcfg" @@ -456,7 +456,7 @@ func ping(ctx context.Context, c *vnet.NodeAgentClient, target netip.Addr) (*ipn anyPong := false for n < 10 { n++ - pr, err := c.PingWithOpts(ctx, target, tailcfg.PingDisco, tailscale.PingOpts{}) + pr, err := c.PingWithOpts(ctx, target, tailcfg.PingDisco, local.PingOpts{}) if err != nil { if anyPong { return res, nil