mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 05:03:09 +00:00
comment
This commit is contained in:
parent
7f9d66525a
commit
44935c2f94
@ -52,7 +52,18 @@ func MakeFakeEtcdClient(t *testing.T) *FakeEtcdClient {
|
|||||||
t: t,
|
t: t,
|
||||||
Data: map[string]EtcdResponseWithError{},
|
Data: map[string]EtcdResponseWithError{},
|
||||||
}
|
}
|
||||||
// Watch() method has not been called.
|
// There are three publicly accessible channels in FakeEtcdClient:
|
||||||
|
// - WatchResponse
|
||||||
|
// - WatchInjectError
|
||||||
|
// - WatchStop
|
||||||
|
// They are only available when Watch() is called. If users of
|
||||||
|
// FakeEtcdClient want to use any of these channels, they have to call
|
||||||
|
// WaitForWatchCompletion before any operation on these channels.
|
||||||
|
// Internally, FakeEtcdClient use condWatchCompleted to indicate if the
|
||||||
|
// Watch() method has been called. WaitForWatchCompletion() will wait
|
||||||
|
// on condWatchCompleted. By the end of the Watch() method, it will
|
||||||
|
// call Broadcast() on condWatchCompleted, which will awake any
|
||||||
|
// goroutine waiting on this condition.
|
||||||
ret.condWatchCompleted = sync.NewCond(&ret.condLock)
|
ret.condWatchCompleted = sync.NewCond(&ret.condLock)
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user