Commit Graph

413 Commits (f1509a102c192035a5467304b34f1226e100d88a)

Author SHA1 Message Date
Gyu-Ho Lee 195744aea6 pkg/flags: warns on shadowed environment variable flags
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-08-09 15:58:48 -07:00
Anthony Romano e9a7f3551b Merge pull request #8281 from heyitsanthony/san-rdns
transport: use reverse lookup to match wildcard DNS SAN
2017-07-22 08:02:57 -07:00
Anthony Romano b1aa962233 transport: use reverse lookup to match wildcard DNS SAN
Fixes #8268
2017-07-21 16:43:25 -07:00
Anthony Romano 426ad25924 transport: include InsecureSkipVerify in TLSInfo
Some functions take a TLSInfo to generate a tls.Config and there was no
way to force the InsecureSkipVerify flag.
2017-07-21 11:00:22 -07:00
Anthony Romano bb42d2b40e testutil: whitelist os.(*file).close
Leak detector is catching goroutines trying to close files which appear
runtime related:

1 instances of:
syscall.Syscall(...)
	/usr/local/golang/1.8.3/go/src/syscall/asm_linux_386.s:20 +0x5
syscall.Close(...)
	/usr/local/golang/1.8.3/go/src/syscall/zsyscall_linux_386.go:296 +0x3d
os.(*file).close(...)
	/usr/local/golang/1.8.3/go/src/os/file_unix.go:140 +0x62

It's unlikely a user goroutine will leak on file close; whitelist it.
2017-07-19 13:28:15 -07:00
Anthony Romano 026e05518e testutil: whitelist WaitGroup.Done
Calling a WaitGroup.Done() in a defer will sometimes trigger the leak
detector since the WaitGroup.Wait() will unblock before the defer
block completes. If the leak detector runs before the Done() is
rescheduled, it will spuriously report the finishing Done() as a leak.
This happens enough in CI to be irritating; whitelist it and ignore.
2017-07-12 14:04:24 -07:00
Anthony Romano ab95eb0795 transport: accept connection if matched IP SAN but no DNS match
The IP SAN check would always do a DNS SAN check if DNS is given
and the connection's IP is verified. Instead, don't check DNS
entries if there's a matching iP.

Fixes #8206
2017-07-06 16:11:53 -07:00
Anthony Romano 5c7efaa288 adt: Union for interval trees 2017-06-21 14:33:15 -07:00
Anthony Romano 322976bedc transport: CRL checking 2017-06-19 15:23:41 -07:00
Anthony Romano a36d62a30c Merge pull request #8049 from heyitsanthony/flock-base-test
fileutil: test some fallback functionality
2017-06-07 16:12:38 -07:00
Anthony Romano c3fcf0f339 fileutil: test some fallback functionality
syscall.Flock fallback and preallocExtendTrunc
2017-06-07 11:22:40 -07:00
Anthony Romano 87a3c87e45 fileutil: return immediately if preallocating 0 bytes
fallocate will return EINVAL, causing zeroing to the end of a
0 byte file to fail.

Fixes #8045
2017-06-07 09:57:14 -07:00
Anthony Romano 88a3bb74b3 test, osutil: disable setting SIG_DFL on linux if built with cov tag
Was causing etcd to terminate before finishing writing its
coverage profile.
2017-06-05 21:09:35 -07:00
Gyu-Ho Lee d690634bd6 *: remove unused, fix typos
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-05-18 12:11:18 -07:00
Anthony Romano a6a1eb8378 Merge pull request #7949 from heyitsanthony/godocs
*: fill out missing package godocs
2017-05-18 10:23:26 -07:00
Anthony Romano 33c375dc44 *: fill out blank package godocs
Mostly one-liner short descriptions, but also includes some typo fixes
and some examples.
2017-05-18 09:41:13 -07:00
Anthony Romano c09f0ca9d4 report: add NewWeightedReport
Reports with weighted results.
2017-05-17 16:07:20 -07:00
Gyu-Ho Lee fba225cee5 pkg/osutil: fix missing 'syscall' import
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-05-15 14:11:54 -07:00
Anthony Romano 74fd7709ad Merge pull request #7904 from heyitsanthony/osutil-exit
osutil: force SIG_DFL before resending terminating signal
2017-05-15 12:14:37 -07:00
Anthony Romano 6ce9aed8c5 Merge pull request #7881 from heyitsanthony/testctl-logging
e2e: more debugging output for lock and elect tests
2017-05-12 12:01:08 -07:00
Anthony Romano 7a1739a3e8 osutil: force SIG_DFL before resending terminating signal
The go runtime won't always reinstall the default signal handler on the
SIGTERM path, so it's possible the signal won't terminate the process.
Instead, force SIG_DFL for the signal.
2017-05-12 11:56:27 -07:00
Anthony Romano 90893735cf Merge pull request #7917 from heyitsanthony/refactor-backend-paths
snap, etcdserver: tighten up snapshot path handling
2017-05-12 09:33:37 -07:00
Anthony Romano 71d7c85b6b expect: reload DEBUG_EXPECT for each process
Lets e2e test cases selectively turn on expect debugging to get
full application output written to stdout.
2017-05-11 16:09:31 -07:00
Anthony Romano f6cd4d4f5b snap, etcdserver: tighten up snapshot path handling
Computing the snapshot file path is error prone; snapshot recovery was
constructing file paths missing a path separator so the snapshot
would never be loaded. Instead, refactor the backend path handling
to use helper functions where possible.
2017-05-11 13:46:59 -07:00
Gyu-Ho Lee 3505c254e1 pkg/srv: fix error checks from resolveTCPAddr
So that 'terr' can be returned later.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-05-11 10:53:03 -07:00
Anthony Romano 07ad18178d pkg/srv: package for SRV utilities
Trying to decouple the v2 client from SRV code. Can't move
into discovery/ since that creates a circular dependency. So,
give up and move all the SRV code into a new package.
2017-05-05 09:27:59 -07:00
Gyu-Ho Lee 747993de08 Merge pull request #7829 from gyuho/certs
pkg/transport: reload TLS certificates for every client requests
2017-04-27 14:36:53 -07:00
Xiang Li d818ef2c76 pkg/wait: add comment and make List private 2017-04-27 13:25:02 -07:00
Tony Grosinger 4e21f87e3d pkg/transport: reload TLS certificates for every client requests
This changes the baseConfig used when creating tls Configs to utilize
the GetCertificate and GetClientCertificate functions to always reload
the certificates from disk whenever they are needed.

Always reloading the certificates allows changing the certificates via
an external process without interrupting etcd.

Fixes #7576

Cherry-picked by Gyu-Ho Lee <gyuhox@gmail.com>
Original commit can be found at https://github.com/coreos/etcd/pull/7784
2017-04-27 11:22:03 -07:00
Anthony Romano 6f06e1cb47 testutil: add assert functions 2017-04-22 20:29:58 -07:00
Anthony Romano 91039bef7c Merge pull request #7799 from heyitsanthony/ctxize-resolve
netutil: use "context" and ctx-ize TCP addr resolution
2017-04-21 16:30:32 -07:00
Anthony Romano 14d6ed9e5f *: clear redundant return statement warnings (S1027) 2017-04-21 14:01:00 -07:00
Anthony Romano 85e87e8f6b netutil: use "context" and ctx-ize TCP addr resolution 2017-04-21 10:01:53 -07:00
Anthony Romano 8fa4b8da6e Merge pull request #7767 from heyitsanthony/transport-resolve-dnsnames
transport: resolve DNSNames when SAN checking
2017-04-18 17:28:01 -07:00
Anthony Romano 05582ad5b2 transport: resolve DNSNames when SAN checking
The current transport client TLS checking will pass an IP address into
VerifyHostnames if there is DNSNames SAN. However, the go runtime will
not resolve the DNS names to match the client IP. Intead, resolve the
names when checking.
2017-04-18 13:21:26 -07:00
Gyu-Ho Lee 5161b74799 pkg/debugutil: add 'mutex' profiler (Go 1.8+)
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-18 10:56:06 -07:00
Gyu-Ho Lee 8aaa1ed911 *: use '*tls.Config.Clone' in Go 1.8
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-17 20:08:27 -07:00
Anthony Romano 1153e1e7d9 Merge pull request #7687 from heyitsanthony/deny-tls-ipsan
transport: deny incoming peer certs with wrong IP SAN
2017-04-13 15:03:25 -07:00
Gyu-Ho Lee 8ce579aac9 pkg/transport: add 'IsClosedConnError'
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-13 11:55:18 -07:00
Anthony Romano 33a0496b5e report: add test for Report interface 2017-04-12 16:41:32 -07:00
Anthony Romano 70a9929b5d transport: use actual certs for listener tests 2017-04-12 13:41:33 -07:00
Anthony Romano cad1215b18 *: deny incoming peer certs with wrong IP SAN 2017-04-12 13:41:33 -07:00
Anthony Romano 88d4e7ebeb netutil: fix unused err staticcheck failure
Clears SA4006
2017-04-07 10:52:54 -07:00
Anthony Romano d42c1f5131 Merge pull request #7646 from andelf/fix-unix-socket-url
*: fix a bug in handling unix socket urls
2017-04-05 09:24:38 -07:00
Gyu-Ho Lee 43f795a485 Merge pull request #7659 from gyuho/aaa
pkg/transport: remove port in Certificate.IPAddresses
2017-04-05 04:29:44 -07:00
andelf 4f27981c46 *: fix a bug in handling unix socket urls
Now use url.Host + url.Path as unix socket path

Fixes #7644
2017-04-05 14:33:13 +08:00
Hitoshi Mitake c4a45c5713 auth, adt: introduce a new type BytesAffineComparable
It will be useful for avoiding a cost of casting from string to
[]byte. The permission checker is the first user of the type.
2017-04-05 13:17:24 +09:00
Gyu-Ho Lee 8a7a548a6d pkg/transport: remove port in Certificate.IPAddresses
etcd passes 'url.URL.Host' to 'SelfCert' which contains
client, peer port. 'net.ParseIP("127.0.0.1:2379")' returns
'nil', and the client on this self-cert will see errors
of '127.0.0.1 because it doesn't contain any IP SANs'

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-04 09:44:59 -07:00
Xiang Li 972d8c55ab Merge pull request #7653 from xiang90/pprof
*: add pprof flag to grpc proxy
2017-04-04 09:22:50 -07:00
Xiang fd5984af56 *: add pprof flag to grpc proxy 2017-04-03 22:07:17 -07:00