mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
rebase: update kubernetes in api folder
updating the kubernetes to 1.31.0 in the api folder. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
2c0e65b828
commit
63c4c05b35
40
api/vendor/k8s.io/apimachinery/pkg/watch/watch.go
generated
vendored
40
api/vendor/k8s.io/apimachinery/pkg/watch/watch.go
generated
vendored
@ -27,13 +27,25 @@ import (
|
||||
|
||||
// Interface can be implemented by anything that knows how to watch and report changes.
|
||||
type Interface interface {
|
||||
// Stop stops watching. Will close the channel returned by ResultChan(). Releases
|
||||
// any resources used by the watch.
|
||||
// Stop tells the producer that the consumer is done watching, so the
|
||||
// producer should stop sending events and close the result channel. The
|
||||
// consumer should keep watching for events until the result channel is
|
||||
// closed.
|
||||
//
|
||||
// Because some implementations may create channels when constructed, Stop
|
||||
// must always be called, even if the consumer has not yet called
|
||||
// ResultChan().
|
||||
//
|
||||
// Only the consumer should call Stop(), not the producer. If the producer
|
||||
// errors and needs to stop the watch prematurely, it should instead send
|
||||
// an error event and close the result channel.
|
||||
Stop()
|
||||
|
||||
// ResultChan returns a chan which will receive all the events. If an error occurs
|
||||
// or Stop() is called, the implementation will close this channel and
|
||||
// release any resources used by the watch.
|
||||
// ResultChan returns a channel which will receive events from the event
|
||||
// producer. If an error occurs or Stop() is called, the producer must
|
||||
// close this channel and release any resources used by the watch.
|
||||
// Closing the result channel tells the consumer that no more events will be
|
||||
// sent.
|
||||
ResultChan() <-chan Event
|
||||
}
|
||||
|
||||
@ -322,3 +334,21 @@ func (pw *ProxyWatcher) ResultChan() <-chan Event {
|
||||
func (pw *ProxyWatcher) StopChan() <-chan struct{} {
|
||||
return pw.stopCh
|
||||
}
|
||||
|
||||
// MockWatcher implements watch.Interface with mockable functions.
|
||||
type MockWatcher struct {
|
||||
StopFunc func()
|
||||
ResultChanFunc func() <-chan Event
|
||||
}
|
||||
|
||||
var _ Interface = &MockWatcher{}
|
||||
|
||||
// Stop calls StopFunc
|
||||
func (mw MockWatcher) Stop() {
|
||||
mw.StopFunc()
|
||||
}
|
||||
|
||||
// ResultChan calls ResultChanFunc
|
||||
func (mw MockWatcher) ResultChan() <-chan Event {
|
||||
return mw.ResultChanFunc()
|
||||
}
|
||||
|
Reference in New Issue
Block a user