Commit Graph

923 Commits (50babc16e7e0acea10b38f64f5c5f9811ba82c76)

Author SHA1 Message Date
Sahdev P. Zala 1cef112a79 etcdserver: do not allow creating empty role
Like user, we should not allow creating empty role.

Related #10905
2019-07-24 17:41:24 -04:00
Tobias Schottdorf b9c051e7a7 raftpb: clean up naming in ConfChange 2019-07-23 10:40:03 +02:00
lzhfromustc 8194aa3f03
Fixed a missing block bug
Description: w.mu is locked at line 385 and unlocked at line 396. Among 5 return statements in this function, 4 are below line 396 but there is 1 return at line 387. 
Fix: Add w.mu.Unlock() before that return at line 387.
2019-06-28 11:27:13 -07:00
Gyuho Lee 1caaa9ed4a test: test update for Go 1.12.5 and related changes
Update to Go 1.12.5 testing. Remove deprecated unused and gosimple
pacakges, and mask staticcheck 1006. Also, fix unconvert errors related
to unnecessary type conversions and following staticcheck errors:
- remove redundant return statements
- use for range instead of for select
- use time.Since instead of time.Now().Sub
- omit comparison to bool constant
- replace T.Fatal and T.Fatalf in tests with T.Error and T.Fatalf respectively because the goroutine calls T.Fatal must be called in the same goroutine as the test
- fix error strings that should not be capitalized
- use sort.Strings(...) instead of sort.Sort(sort.StringSlice(...))
- use he status code of Canceled instead of grpc.ErrClientConnClosing which is deprecated
- use use status.Errorf instead of grpc.Errorf which is deprecated

Related #10528 #10438
2019-06-05 17:02:05 -04:00
Xiang Li ea0f919cdc
Merge pull request #10775 from jingyih/integration_member_promote_failed_cases
clientv3/integration: add member promote failure test cases
2019-06-02 20:39:00 -07:00
Jingyi Hu ec17872c98 integration: add member promote failure test cases
Add TestMemberPromoteMemberNotLearner and
TestMemberPromoteMemberNotExist.
2019-05-31 10:52:54 -07:00
Hitoshi Mitake 5a67dd788d *: support creating a user without password
This commit adds a feature for creating a user without password. The
purpose of the feature is reducing attack surface by configuring bad
passwords (CN based auth will be allowed for the user).

The feature can be used with `--no-password` of `etcdctl user add`
command.

Fix https://github.com/coreos/etcd/issues/9590
2019-05-30 21:59:30 +09:00
Xiang Li 23a89b0f09
Merge pull request #10755 from wrfly/patch-3
fix #10754
2019-05-28 20:50:52 -07:00
Shaun 3754767dbc clientv3: return getToken error when retryAuth 2019-05-29 10:15:22 +08:00
Jingyi Hu 6bf609b96d integration: update TestMemberPromote test
Update TestMemberPromote to include both learner not-ready and learner
ready test cases.

Removed unit test TestPromoteMember, it requires underlying raft node to
be started and running. The member promote is covered by the integration
test.
2019-05-28 18:50:13 -07:00
Jingyi Hu f8ad8ae4ad etcdserver: use etcdserver ErrLearnerNotReady
If learner is not ready to be promoted, use etcdserver.ErrLearnerNotReady
instead of using membership.ErrLearnerNotReady.
2019-05-28 18:50:13 -07:00
宇慕 dfe296ac3c etcdserver: add mayPromote check 2019-05-28 18:47:03 -07:00
Jingyi Hu 7a4d233bab clientv3/integration: better way to deflake test
Use ReadyNotify instead of time.Sleep to wait for server ready.
2019-05-28 18:47:03 -07:00
Jingyi Hu aa4cda2f5c etcdserver: allow 1 learner in cluster
Hard-coded the maximum number of learners to 1.
2019-05-28 18:47:03 -07:00
Jingyi Hu d0c1b3fa38 etcdserver: learner return Unavailable for unsupported RPC
Make learner return code.Unavailable when the request is not supported
by learner. Client balancer will retry a different endpoint.
2019-05-28 18:47:03 -07:00
Gyuho Lee 34bd797e67 *: revert module import paths
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-05-28 15:39:35 -07:00
Gyuho Lee 11d3f74c33
Merge pull request #10744 from philips/drop-readthedocs
*: move to etcd.io for docs
2019-05-27 03:02:01 -07:00
Inconnu08 2eaed14def clientv3: fix typo in test filename 2019-05-27 13:53:58 +06:00
Brandon Philips c5e5240004
*: move to etcd.io for docs
Remove all readthedocs references for https://etcd.io to ensure the SEO
goes to the right place.
2019-05-20 14:32:08 -07:00
Jingyi Hu 23f1d02391 *: address comments 2019-05-15 15:58:46 -07:00
Jingyi Hu 90d28c0de7 clientv3/integration: deflake TestKVForLearner
Adding delay in the test for the newly started learner member to catch
up applying config change entries in raft log.
2019-05-15 13:58:28 -07:00
Jingyi Hu b23c8f3e8f clientv3/integration: fix cluster tests
Fixes TestMemberAddForLearner and TestMemberPromoteForLearner.
2019-05-15 13:58:26 -07:00
WizardCXY a039f2efb8 clientv3, etcdctl: MemberPromote for learner 2019-05-15 13:48:52 -07:00
WizardCXY 7f9479acc1 clientv3: add member promote 2019-05-15 13:27:42 -07:00
Jingyi Hu 57a11eb1e1 integration: add TestKVForLearner
Adding TestKVForLearner. Also adding test utility functions for clientv3
integration tests.
2019-05-15 13:27:38 -07:00
Jingyi Hu 2b76200f70 *: add MemberAddAsLearner to clientv3 Cluster API
Made changes to Clientv3 Cluster API:

- Added MemberAddAsLearner.
- Reverted changes to MemberAdd - removed input parameter isLearner.
2019-05-14 16:56:44 -07:00
Jingyi Hu fc14608cb7 clientv3: support MemberAdd for learner
Added IsLearner flag to clientv3 MemberAdd API.
2019-05-14 13:10:22 -07:00
Jingyi Hu a0d3c4d641 *: fix compilation after API change
Fixed compilation erros after API change for learner.
2019-05-14 13:10:22 -07:00
rohitsardesai83 42a7ea6d33 etcd: Replace ghodss/yaml with sigs.k8s.io/yaml
To remove the dependency on ghodss/yaml. Replaced this dependency with sigs.k8s.io/yaml.
This wil help to remove the ghodss/yaml dependency from main kubernetes repository.

xref: https://github.com/kubernetes/kubernetes/issues/77024
2019-05-02 12:34:36 +05:30
Gyuho Lee e899023f3f
Merge pull request #10640 from shrajfr12/gomodulecompat
Fix module path to have the major version to comply with go modules specification.
2019-05-01 22:46:03 -07:00
Xiang Li fc6936863a
Merge pull request #10582 from johncming/empty_update
clientv3/naming: ignore empty update.
2019-04-30 14:21:56 -07:00
Xiang Li 1bd02b2053
Merge pull request #10595 from johncming/locking
clientv3: modify lock type.
2019-04-30 14:19:02 -07:00
shivaramr 9150bf52d6 go modules: Fix module path version to include version number 2019-04-26 15:29:50 -07:00
Joe Betz c7c6894527
Merge pull request #10551 from johncming/lbname
clientv3/balancer: change balancer name to builder name.
2019-04-10 16:16:51 -07:00
zhoulin xie cc08c1bd2e clientv3/integration/leasing_test.go: Fix t.Fatalf error message
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-04-10 13:19:50 -04:00
johncming 9b5c468dc6 clientv3: modify lock type. 2019-03-29 21:02:13 +08:00
johncming cb39c97b22 clientv3/naming: ignore empty update. 2019-03-25 10:53:24 +08:00
mengjin 41f7142ff9 doc: fix document example error 2019-03-21 08:21:03 -04:00
Xiang Li 09d0844379
Merge pull request #10548 from jingyih/add_TestMemberAddWithExistingURLs
clientv3/integration: Add TestMemberAddWithExistingURLs
2019-03-19 15:23:15 -07:00
Jingyi Hu 9bd86a647f clientv3: Add TestMemberAddWithExistingURLs
TestMemberAddWithExistingURLs ensures adding a new member with URLs
already being used in the cluster will not succeed.
2019-03-18 12:48:44 -07:00
johncming ddff08ffad clientv3/balancer: change balancer name to builder name. 2019-03-18 11:05:22 +08:00
johncming 662fd55084 clientv3: clean up unused code. 2019-03-18 10:34:41 +08:00
Xiang Li e1ca3b4434
Merge pull request #10531 from JoeWrightss/patch-3
Fix some variable spelling errors
2019-03-12 12:09:09 -07:00
zhoulin xie 939b4f8599 clientv3/balancer/grpc1.7-health.go: Fix variable spelling error
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-03-10 01:11:02 +08:00
Xiang Li 4dc9d8b058
Merge pull request #10503 from spzala/v3argorder10431
clientV3: fix behavior of WithPrefix and WithFromKey functions
2019-03-08 11:59:17 -08:00
Xiang Li e80d1745be
Merge pull request #10420 from spzala/watch10340
clientV3watch: do not return ctx canceled when Close watch
2019-03-08 11:57:44 -08:00
Sahdev P. Zala b25edb62cc clientV3watch: Watch Close should close successfully
Closing of watch by client will cancel the watch grpc stream and
can produce a context canceled error. However, since client
simply wanted to close the watcher the error can create confusion
that something went wrong instead of a successful close. Ensure
that Close do not return error.

Fixed #10340
2019-02-28 20:43:20 -05:00
Sahdev P. Zala 8782bbae65 clientV3: fix behavior of WithPrefix and WithFromKey functions
The use of WithPrefix() and WithFromKey() together is not supported. The
client doesn't respect this behavior currently.

Fixes #10431
2019-02-27 09:23:01 -05:00
Xiang Li 17de9bd526
Merge pull request #10501 from datuanmac/replacing_http_by_https
doc: Replacing 'HTTP' by 'HTTPS' for securing links
2019-02-27 14:08:24 +08:00
Tuan Do Anh 32389b1876 doc: Replacing 'HTTP' by 'HTTPS' for securing links
Currently, when we access the URL https://www.grpc.io, it is redirected to https://www.grpc.io automatically.
So this commit aims to replace **HTTP** to **HTTPs** for security.
2019-02-27 10:15:22 +07:00