Mirror of tailscale/tailscale@github.com
Go to file
James Tucker 5c38f0979e tsweb/promvarz: fix repeated expvar definition in test
expvar can only be defined once, so running tests with a repeat counter
will fail if the variables are defined inside of the test function.

Observed failure:

```
--- FAIL: TestHandler (0.00s)
panic: Reuse of exported var name: gauge_promvarz_test_expvar
 [recovered]
        panic: Reuse of exported var name: gauge_promvarz_test_expvar

goroutine 9 [running]:
testing.tRunner.func1.2({0x100f267e0, 0x1400026e770})
        /usr/local/go/src/testing/testing.go:1526 +0x1c8
testing.tRunner.func1()
        /usr/local/go/src/testing/testing.go:1529 +0x364
panic({0x100f267e0, 0x1400026e770})
        /usr/local/go/src/runtime/panic.go:884 +0x1f4
log.Panicln({0x140000b8e20?, 0x1a?, 0x1400026e750?})
        /usr/local/go/src/log/log.go:398 +0x60
expvar.Publish({0x100e2b21d, 0x1a}, {0x100fd7a08?, 0x140000232c0})
        /usr/local/go/src/expvar/expvar.go:284 +0xc0
expvar.NewInt(...)
        /usr/local/go/src/expvar/expvar.go:304
tailscale.com/tsweb/promvarz.TestHandler(0x14000082b60)
        /Users/charlotte/ts-src/tailscale/tsweb/promvarz/promvarz_test.go:18 +0x5c
testing.tRunner(0x14000082b60, 0x100fd5858)
        /usr/local/go/src/testing/testing.go:1576 +0x104
created by testing.(*T).Run
        /usr/local/go/src/testing/testing.go:1629 +0x370
FAIL    tailscale.com/tsweb/promvarz    0.149s
```

Fixes #8065
Signed-off-by: James Tucker <james@tailscale.com>
2023-05-06 09:53:09 -07:00
.bencher
.github .github: mark bots for exemption by issuebot (#8041) 2023-05-03 18:36:19 -07:00
atomicfile
chirp
client/tailscale
cmd tsd: add package with System type to unify subsystem init, discovery 2023-05-04 14:21:59 -07:00
control control/controlclient: use dnscache.Resolver for Noise client 2023-05-01 13:22:10 -07:00
derp derp: add a README.md with some docs 2023-05-02 13:42:25 -07:00
disco
docs
doctor
envknob envknob: support tailscaled-env.txt on macOS too 2023-05-04 10:27:59 -07:00
health
hostinfo various: add detection and Taildrop for Unraid 2023-05-04 13:40:13 -07:00
internal/tooldeps
ipn ipn/ipnlocal: add NodeKey func to return the public node NodeKey 2023-05-05 14:22:59 -07:00
jsondb
kube
licenses licenses: update tailscale{,d} licenses 2023-05-03 19:56:00 -07:00
log all: avoid repeated default interface lookups 2023-04-20 15:46:01 -07:00
logpolicy all: avoid repeated default interface lookups 2023-04-20 15:46:01 -07:00
logtail all: move network monitoring from wgengine/monitor to net/netmon 2023-04-20 10:15:59 -07:00
metrics
net net/netns: fix segv when no tailscale interface is found 2023-05-05 11:31:43 -07:00
packages/deb
paths
portlist
prober all: avoid repeated default interface lookups 2023-04-20 15:46:01 -07:00
release
safesocket safesocket: enable test to run on Windows unpriviliged 2023-04-19 19:06:18 -07:00
scripts scripts/installer.sh: check connectivity with pkgs.tailscale.com 2023-05-04 16:49:56 +02:00
smallzstd
ssh/tailssh ssh/tailssh,tailcfg: add connID to ssheventnotifyrequest and castheader 2023-05-05 14:22:59 -07:00
syncs syncs: add Map.Len to get the length of the Map 2023-04-27 19:10:28 -07:00
tailcfg tailcfg: bump capability version 2023-05-05 14:22:59 -07:00
tempfork
tka
tool
tsconst
tsd tsd: add package with System type to unify subsystem init, discovery 2023-05-04 14:21:59 -07:00
tsnet tsd: add package with System type to unify subsystem init, discovery 2023-05-04 14:21:59 -07:00
tstest tsd: add package with System type to unify subsystem init, discovery 2023-05-04 14:21:59 -07:00
tstime
tsweb tsweb/promvarz: fix repeated expvar definition in test 2023-05-06 09:53:09 -07:00
types net/packet: add NAT support for DCCP and GRE 2023-04-24 15:30:50 -07:00
util
version various: add detection and Taildrop for Unraid 2023-05-04 13:40:13 -07:00
wf
wgengine tsd: add package with System type to unify subsystem init, discovery 2023-05-04 14:21:59 -07:00
words words: charlotte 1 spell-checking-linter 0 (#7993) 2023-04-27 08:58:52 -07:00
.gitattributes
.gitignore
.golangci.yml ci: add more lints (#7909) 2023-04-19 21:54:19 -04:00
ALPINE.txt
AUTHORS
CODE_OF_CONDUCT.md
Dockerfile
Dockerfile.base
LICENSE
Makefile
PATENTS
README.md
SECURITY.md
VERSION.txt VERSION.txt: this is v1.41.0 2023-04-26 15:58:30 -07:00
api.md
build_dist.sh build_dist.sh: make cross-compilation friendly for env CC specified 2023-04-27 18:51:59 -07:00
build_docker.sh
flake.lock
flake.nix go.mod.sri: update SRI hash for go.mod changes 2023-05-04 12:55:01 -07:00
go.mod go.mod: bump goreleaser deps 2023-05-04 12:32:24 -07:00
go.mod.sri go.mod.sri: update SRI hash for go.mod changes 2023-05-04 12:55:01 -07:00
go.sum go.mod: bump goreleaser deps 2023-05-04 12:32:24 -07:00
go.toolchain.branch
go.toolchain.rev
pull-toolchain.sh
shell.nix go.mod.sri: update SRI hash for go.mod changes 2023-05-04 12:55:01 -07:00
staticcheck.conf
update-flake.sh
version-embed.go
version_test.go

README.md

Tailscale

https://tailscale.com

Private WireGuard® networks made easy

Overview

This repository contains the majority of Tailscale's open source code. Notably, it includes the tailscaled daemon and the tailscale CLI tool. The tailscaled daemon runs on Linux, Windows, macOS, and to varying degrees on FreeBSD and OpenBSD. The Tailscale iOS and Android apps use this repo's code, but this repo doesn't contain the mobile GUI code.

Other Tailscale repos of note:

For background on which parts of Tailscale are open source and why, see https://tailscale.com/opensource/.

Using

We serve packages for a variety of distros and platforms at https://pkgs.tailscale.com.

Other clients

The macOS, iOS, and Windows clients use the code in this repository but additionally include small GUI wrappers. The GUI wrappers on non-open source platforms are themselves not open source.

Building

We always require the latest Go release, currently Go 1.20. (While we build releases with our Go fork, its use is not required.)

go install tailscale.com/cmd/tailscale{,d}

If you're packaging Tailscale for distribution, use build_dist.sh instead, to burn commit IDs and version info into the binaries:

./build_dist.sh tailscale.com/cmd/tailscale
./build_dist.sh tailscale.com/cmd/tailscaled

If your distro has conventions that preclude the use of build_dist.sh, please do the equivalent of what it does in your distro's way, so that bug reports contain useful version information.

Bugs

Please file any issues about this code or the hosted service on the issue tracker.

Contributing

PRs welcome! But please file bugs. Commit messages should reference bugs.

We require Developer Certificate of Origin Signed-off-by lines in commits.

See git log for our commit message style. It's basically the same as Go's style.

About Us

Tailscale is primarily developed by the people at https://github.com/orgs/tailscale/people. For other contributors, see:

WireGuard is a registered trademark of Jason A. Donenfeld.