mirror of https://github.com/k3s-io/k3s
Generate modification index only if f.TestIndex is specified.
This is for compatibility with existing tests.pull/6/head
parent
b82bb37c89
commit
e40cdd50ed
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue