From 15d6c55d74629b8fe0368ebf13956d57b842bb72 Mon Sep 17 00:00:00 2001 From: ale <ale@incal.net> Date: Fri, 15 Nov 2013 20:33:46 +0000 Subject: [PATCH] the go-etcd 0.2.0-rc1 tag lags slightly behind the etcd release, sync to commit 8a44ce0 for ModifiedIndex --- .../github.com/coreos/go-etcd/etcd/compare_and_swap_test.go | 2 +- third_party/github.com/coreos/go-etcd/etcd/response.go | 2 +- third_party/github.com/coreos/go-etcd/etcd/watch.go | 2 +- third_party/github.com/coreos/go-etcd/etcd/watch_test.go | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/third_party/github.com/coreos/go-etcd/etcd/compare_and_swap_test.go b/third_party/github.com/coreos/go-etcd/etcd/compare_and_swap_test.go index 647aadff..bc452a91 100644 --- a/third_party/github.com/coreos/go-etcd/etcd/compare_and_swap_test.go +++ b/third_party/github.com/coreos/go-etcd/etcd/compare_and_swap_test.go @@ -34,7 +34,7 @@ func TestCompareAndSwap(t *testing.T) { } // This should succeed - resp, err = c.CompareAndSwap("foo", "bar2", 5, "", resp.Index) + resp, err = c.CompareAndSwap("foo", "bar2", 5, "", resp.ModifiedIndex) if err != nil { t.Fatal(err) } diff --git a/third_party/github.com/coreos/go-etcd/etcd/response.go b/third_party/github.com/coreos/go-etcd/etcd/response.go index 4bf0c883..d05b8f45 100644 --- a/third_party/github.com/coreos/go-etcd/etcd/response.go +++ b/third_party/github.com/coreos/go-etcd/etcd/response.go @@ -23,7 +23,7 @@ type Response struct { TTL int64 `json:"ttl,omitempty"` // The command index of the raft machine when the command is executed - Index uint64 `json:"index"` + ModifiedIndex uint64 `json:"modifiedIndex"` } // When user list a directory, we add all the node into key-value pair slice diff --git a/third_party/github.com/coreos/go-etcd/etcd/watch.go b/third_party/github.com/coreos/go-etcd/etcd/watch.go index e770f1a2..bbce2039 100644 --- a/third_party/github.com/coreos/go-etcd/etcd/watch.go +++ b/third_party/github.com/coreos/go-etcd/etcd/watch.go @@ -41,7 +41,7 @@ func (c *Client) watch(prefix string, waitIndex uint64, recursive bool, receiver for { resp, err := c.watchOnce(prefix, waitIndex, recursive, stop) if resp != nil { - waitIndex = resp.Index + 1 + waitIndex = resp.ModifiedIndex + 1 receiver <- resp } else { return nil, err diff --git a/third_party/github.com/coreos/go-etcd/etcd/watch_test.go b/third_party/github.com/coreos/go-etcd/etcd/watch_test.go index f4efd9fd..10fc2b6b 100644 --- a/third_party/github.com/coreos/go-etcd/etcd/watch_test.go +++ b/third_party/github.com/coreos/go-etcd/etcd/watch_test.go @@ -24,7 +24,7 @@ func TestWatch(t *testing.T) { go setHelper("watch_foo", "bar", c) - resp, err = c.Watch("watch_foo", resp.Index, nil, nil) + resp, err = c.Watch("watch_foo", resp.ModifiedIndex, nil, nil) if err != nil { t.Fatal(err) } @@ -63,7 +63,7 @@ func TestWatchAll(t *testing.T) { go setHelper("watch_foo/foo", "bar", c) - resp, err = c.WatchAll("watch_foo", resp.Index, nil, nil) + resp, err = c.WatchAll("watch_foo", resp.ModifiedIndex, nil, nil) if err != nil { t.Fatal(err) } -- GitLab