client-go/tools/cache/testing
Andrew Stoycos f19a514ff5 Fix Panic Condition
Currenlty an event recorder can send an event to a
broadcaster that is already stopped, resulting
in a panic.  This ensures the broadcaster holds
a lock while it is shutting down and then forces
any senders to drop queued events following
broadcaster shutdown.

It also updates the Action, ActionOrDrop,  Watch,
and WatchWithPrefix functions to return an error
in the case where data is sent on the closed bradcaster
channel rather than panicing.

Lastly it updates unit tests to ensure the fix works correctly

fixes: https://github.com/kubernetes/kubernetes/issues/108518

Signed-off-by: Andrew Stoycos <astoycos@redhat.com>

Kubernetes-commit: 6aa779f4ed3d3acdad2f2bf17fb27e11e23aabe4
2022-02-11 14:50:19 -05:00
..
fake_controller_source_test.go client-go/cache/testing: add ability to simulate watch disruption 2019-12-06 22:19:42 +01:00
fake_controller_source.go Fix Panic Condition 2022-02-11 14:50:19 -05:00