From e40cdd50edcea094cce4abacab5bca298547627a Mon Sep 17 00:00:00 2001 From: Kouhei Ueno Date: Thu, 31 Jul 2014 16:01:28 +0900 Subject: [PATCH] Generate modification index only if f.TestIndex is specified. This is for compatibility with existing tests. --- pkg/tools/fake_etcd_client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/tools/fake_etcd_client.go b/pkg/tools/fake_etcd_client.go index 3a6be8b9b29..d4ae285e3a8 100644 --- a/pkg/tools/fake_etcd_client.go +++ b/pkg/tools/fake_etcd_client.go @@ -41,6 +41,7 @@ type FakeEtcdClient struct { Err error t TestLogger Ix int + TestIndex bool ChangeIndex uint64 // Will become valid after Watch is called; tester may write to it. Tester may @@ -72,6 +73,10 @@ func MakeFakeEtcdClient(t TestLogger) *FakeEtcdClient { } func (f *FakeEtcdClient) generateIndex() uint64 { + if !f.TestIndex { + return 0 + } + f.ChangeIndex++ return f.ChangeIndex }