mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: update kubernetes to v1.21.2
Updated kubernetes packages to latest release. resizefs package has been included into k8s.io/mount-utils package. updated code to use the same. Updates: #1968 Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
28
vendor/k8s.io/apimachinery/pkg/watch/mux.go
generated
vendored
28
vendor/k8s.io/apimachinery/pkg/watch/mux.go
generated
vendored
@ -74,6 +74,22 @@ func NewBroadcaster(queueLength int, fullChannelBehavior FullChannelBehavior) *B
|
||||
return m
|
||||
}
|
||||
|
||||
// NewLongQueueBroadcaster functions nearly identically to NewBroadcaster,
|
||||
// except that the incoming queue is the same size as the outgoing queues
|
||||
// (specified by queueLength).
|
||||
func NewLongQueueBroadcaster(queueLength int, fullChannelBehavior FullChannelBehavior) *Broadcaster {
|
||||
m := &Broadcaster{
|
||||
watchers: map[int64]*broadcasterWatcher{},
|
||||
incoming: make(chan Event, queueLength),
|
||||
stopped: make(chan struct{}),
|
||||
watchQueueLength: queueLength,
|
||||
fullChannelBehavior: fullChannelBehavior,
|
||||
}
|
||||
m.distributing.Add(1)
|
||||
go m.loop()
|
||||
return m
|
||||
}
|
||||
|
||||
const internalRunFunctionMarker = "internal-do-function"
|
||||
|
||||
// a function type we can shoehorn into the queue.
|
||||
@ -198,6 +214,18 @@ func (m *Broadcaster) Action(action EventType, obj runtime.Object) {
|
||||
m.incoming <- Event{action, obj}
|
||||
}
|
||||
|
||||
// Action distributes the given event among all watchers, or drops it on the floor
|
||||
// if too many incoming actions are queued up. Returns true if the action was sent,
|
||||
// false if dropped.
|
||||
func (m *Broadcaster) ActionOrDrop(action EventType, obj runtime.Object) bool {
|
||||
select {
|
||||
case m.incoming <- Event{action, obj}:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// Shutdown disconnects all watchers (but any queued events will still be distributed).
|
||||
// You must not call Action or Watch* after calling Shutdown. This call blocks
|
||||
// until all events have been distributed through the outbound channels. Note
|
||||
|
Reference in New Issue
Block a user