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
|
Err error
|
||||||
t TestLogger
|
t TestLogger
|
||||||
Ix int
|
Ix int
|
||||||
|
TestIndex bool
|
||||||
ChangeIndex uint64
|
ChangeIndex uint64
|
||||||
|
|
||||||
// Will become valid after Watch is called; tester may write to it. Tester may
|
// 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 {
|
func (f *FakeEtcdClient) generateIndex() uint64 {
|
||||||
|
if !f.TestIndex {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
f.ChangeIndex++
|
f.ChangeIndex++
|
||||||
return f.ChangeIndex
|
return f.ChangeIndex
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue