Commit Graph

140 Commits (374b14e47189c249c069c9b3376cf5c36f286fa6)

Author SHA1 Message Date
Gyu-Ho Lee dd02ec6554 etcdctl: ignore value in updatedir command
Fixes coreos#4145.
client.KeysAPI ignores value if SetOptions.Dir is true.
2016-01-06 16:37:04 -08:00
Xiang Li 34abead33e etcdctl: fix syncWithPeerAPI by breaking the loop when there is no error 2015-12-30 11:06:42 -08:00
Anthony Romano 4477ef636e etcdctl: return exitcode 2 if can't connect to any peers 2015-12-28 23:04:34 -08:00
Xiang Li 2681137fe0 Merge pull request #4020 from xiang90/ctl_04
etcdctl: support etcd0.4
2015-12-21 12:55:03 -08:00
Xiang Li 541f2e5200 etcdctl: support basic operations with etcd 0.4.
For CoreOS users, they will get a updated version of etcdctl without updating
the etcd server version. And the users cannot really control this behavior.
We do not want to suddenly break them without enough communication.

So we still want the most basic opeartions like get, set, watch of etcdctl2 work
with etcd 0.4. This patches solve the incompability issue.
2015-12-21 11:59:13 -08:00
Anthony Romano 2974c4ec27 etcdctl: fill out ArgsUsage fields for help
USAGE in help now names positional arguments (e.g., "member remove <memberID>"
instead of "member remove [arguments...]")

Fixes #4021
2015-12-21 09:05:37 -08:00
Gyu-Ho Lee bccc602c8f etcdctl/command: fix shawdowed error variable
This fixes https://github.com/coreos/etcd/issues/3954.
2015-12-12 09:13:12 -08:00
Gyu-Ho Lee e8215cc577 etcdctl: remove duplicate exit line
`handleError` already exits with the exit code in arguments.
`os.Exit(1)` is never executed in this case.
2015-11-25 09:41:27 -08:00
Xiang Li e39206e084 etcdctl: cluster health exit with non-zero when cluster is unhealthy 2015-11-20 13:51:31 -08:00
Hitoshi Mitake 11f49a0960 etcdctl: a new option for quorum get
Current etcdctl seems to lack an option for specifying quorum flag for
GET. This commit adds the option.
2015-11-20 14:09:50 +09:00
Gyu-Ho Lee 81229dbea9 *: add missing package descriptions
This adds and updates package descriptions in etcd projects.
And also deletes some duplicate LICENSE statements.
2015-11-17 20:54:10 -08:00
mqliang b2d92dedae etcdctl:fix health check condition 2015-10-18 08:22:13 +08:00
Gyu-Ho Lee 1dab7e8084 etcdctl/command: mk command with PrevNoExist
This attempts to fix #3676. `PrevNoExist` checks if the key previously exists
and if so, it returns an error, which is how `mk` command is supposed to work.
The previous code ignores the previous key and overwrites with the later value.

/cc @yichengq
2015-10-15 09:05:17 -07:00
Yicheng Qin afd74dfeb7 Merge pull request #3611 from mitake/etcdctl-timeout
etcdctl: use a context with -total-timeout in simple commands
2015-10-14 16:13:34 -07:00
Yicheng Qin 9673eb625a pkg/transport: pass dial timeout to NewTransport
So we could set dial timeout for new transport, which makes it
customizable according to max RTT.
2015-10-11 10:09:25 -07:00
Hitoshi Mitake 33a0df3e33 etcdctl: use a context with -total-timeout in simple commands
Like the commit 8ebc933111, this commit lets simple etcdctl commands
use a context with timeout value passed via -total-timeout.

This commit doesn't change complex commands like watch,
cluster-health, and import because it is not obvious that using the
context in the commands is good or not.
2015-09-29 17:23:01 +09:00
Hitoshi Mitake 8ebc933111 etcdctl: use user specified timeout value for entire command execution
etcdctl should be capable to use a user specified timeout value for
total command execution, not only per request timeout. This commit
adds a new option --total-timeout to the command. The value passed via
this option is used as a timeout value of entire command execution.

Fixes coreos#3517
2015-09-28 10:31:46 +09:00
Jonathan Boulle 7848ac3979 *: add missing license headers 2015-09-15 14:09:01 -07:00
Dmitry Smirnov b2f4a5f587 *: fix spelling issues (codespell).
Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>
2015-09-11 10:22:29 +10:00
Xiang Li 322aab133d etcdctl: suggest endpoint over peer 2015-09-04 13:16:33 -07:00
Xiang Li 04539c6240 etcdctl: prepare for health endpoint change
We made a mistake on the health endpoint by returning a string "true".
We have to make the etcdctl works for the next version of etcd which
will correct the mistake on the server side.

It is too late to change the server side right now since we already
released a version of etcdctl that only understands "true".
2015-09-04 10:20:24 -07:00
Yicheng Qin 8e040efed9 etcdctl: log more about sync process
Users don't even know that etcdctl is doing sync and fails on sync
process. So we add more logs for sync process.
2015-09-02 16:10:25 -07:00
Yicheng Qin 423e3bbbd8 etcdctl/cluster_health: provide better message for empty client urls
It skips sync when init client, and prints out unreachable messagen and
points to notice when checking health of etcd members one by one.
2015-09-01 14:42:19 -07:00
Yicheng Qin c2caa4ae3b etcdctl/command: print more details about ErrNoEndpoint
This commit prints more details if getting ErrNoEndpoint when sync with
cluster. This helps users to know what happens.
2015-08-31 16:28:43 -07:00
Xiang Li 8d8033df55 etcdctl: suggest endpoint over peers flag 2015-08-27 18:52:17 -07:00
Xiang Li 044b23c3ca Merge pull request #3356 from xiang90/travis
*: test gofmt with -s and fix reported issues
2015-08-21 18:59:51 -07:00
Xiang Li 6b23a8131f *: test gofmt with -s and fix reported issues 2015-08-21 18:52:16 -07:00
Yicheng Qin 224755855d etcdctl/cluster_health: set health var when checked healthy
This was a typo.
2015-08-21 15:27:35 -07:00
Xiang Li b0303e948c Merge pull request #3323 from xiang90/cl_health
etcdctl: use health endpoint to greatly simplify health checking
2015-08-19 17:15:52 -07:00
Xiang Li 568d1c6783 etcdctl: use health endpoint to greatly simplify health checking 2015-08-19 11:47:08 -07:00
Yicheng Qin fab3feab66 etcdctl/role: reject non-canonical permission path
Non-canonical permission path is useless because the path received
by auth is always canonical, which is due to our ServeMux always
redirects request to canonical path().

This helps users to detect path permission setting error early.

Ref: http://godoc.org/net/http#ServeMux
2015-08-18 08:59:53 -07:00
Xiang Li 7e04a79fb4 etcdctl: print out better error information 2015-08-12 10:09:56 -07:00
Xiang Li e36c499d0f etcdctl: add per request timeout 2015-08-11 13:33:50 -07:00
Xiang Li 845c51fedd *: fix typos vaild->valid 2015-08-07 10:57:11 -07:00
Xiang Li 9527a97720 etcdctl: ls takes / as default key arg 2015-08-04 22:56:55 -07:00
Xiang Li ff5c3469c1 Merge pull request #3197 from xiang90/health
etcdctl: cluster-health supports forever flag
2015-08-03 20:48:06 -07:00
Xiang Li f7f00b0af6 etcdctl: cluster-health supports forever flag
cluster-health command supports checking the cluster health
forever.
2015-08-01 22:29:08 +08:00
Yicheng Qin 147885078c etcdctl: fix watch -after-index parsing
It uses -after-index incorrectly now:

```
$ ./bin/etcdctl --debug watch -after-index 31 foo
Cluster-Endpoints: http://localhost:2379, http://localhost:4001
cURL Command: curl -X GET
http://localhost:2379/v2/keys/foo?recursive=false&wait=true&waitIndex=33
```

After this PR:

```
$ ./bin/etcdctl --debug watch -after-index 31 foo
Cluster-Endpoints: http://localhost:2379, http://localhost:4001
cURL Command: curl -X GET
http://localhost:2379/v2/keys/foo?recursive=false&wait=true&waitIndex=32
```
2015-07-30 11:15:43 -07:00
Yicheng Qin f1aaa7a9e3 etcdctl: refactor the way to check cluster health
This method uses raft status exposed at /debug/varz to determine the
health of the cluster. It uses whether commit index increases to
determine the cluster health, and uses whether match index increases to
determine the member health.

This could fix the bug #2711 that fails to detect follower is unhealthy
because it doesn't rely on whether message in long-polling connection is sent.

This health check is stricter than the old one, and reflects the
situation that whether followers are healthy in the view of the leader. One
example is that if the follower is receiving the snapshot, it will turns
out to be unhealthy because it doesn't move forward.

`etcdctl cluster-health` will reflect the healthy view in the raft level,
while connectivity checks reflects the healthy view in transport level.
2015-07-29 17:06:55 -07:00
Xiang Li 448ca20cdc etcdctl: fix exec watch command
The previous flag parsing has a small issue. It uses
`recursive == true` and `after-index == 0` to determine
if user specifies the sub flags. This is incorrect since
user can specify `after-index = 0`. Then the flag parsing
would be confused.

This commit explicitly find the `--` in the remaining args
and determine the key and cmdArgs accordingly.
2015-07-23 13:13:15 +08:00
Yicheng Qin 604709cad7 etcdctl: update -peers to default to use schema
Change its default value from `127.0.0.1:4001,127.0.0.1:2379` to
`http://127.0.0.1:4001,http://127.0.0.1:2379`

Adding HTTP schema makes its format consistent with etcd's xxx-urls
flags.
2015-07-21 12:53:21 -07:00
Mohammad Samman 43437e21f9 etcdctl: added domain discovery flag
provided a domain, will look up SRV records for etcd endpoints

Fixes #2636
2015-07-21 12:53:21 -07:00
Xiang Li ee82ee05b4 etcdctl: support member update command 2015-07-21 12:53:20 -07:00
Xiang Li 9f9661f513 etcdctl: print out key and action when watching recursively 2015-07-21 12:53:20 -07:00
Xiang Li 87ef0f0b3e godep: remove go-etcd dependency 2015-07-21 12:53:20 -07:00
Xiang Li 071ad9f72b etcdctl: health use etcd/client 2015-07-21 12:53:20 -07:00
Xiang Li 0b1ddce889 etcdctl: import snap use etcd/client 2015-07-21 12:53:20 -07:00
Xiang Li adeb101e04 etcdctl: remove old stuff 2015-07-21 12:53:20 -07:00
Xiang Li 759c156e3e etcdctl: exec_watch use etcd/client 2015-07-21 12:53:20 -07:00
Xiang Li 5b01b3877f etcdctl: watch use etcd/client 2015-07-21 12:53:20 -07:00