diff --git a/kubernetes/watcher.go b/kubernetes/watcher.go index c18a6f468..9b02c93f2 100644 --- a/kubernetes/watcher.go +++ b/kubernetes/watcher.go @@ -54,6 +54,9 @@ type Watcher interface { // AddEventHandler add event handlers for corresponding event type watched AddEventHandler(ResourceEventHandler) + // GetEventHandler returns the event handlers for corresponding event type watched + GetEventHandler() ResourceEventHandler + // Store returns the store object for the watcher Store() cache.Store @@ -181,6 +184,11 @@ func (w *watcher) AddEventHandler(h ResourceEventHandler) { w.handler = h } +// GetEventHandler returns the watcher's event handler +func (w *watcher) GetEventHandler() ResourceEventHandler { + return w.handler +} + // Store returns the store object for the resource that is being watched func (w *watcher) Store() cache.Store { return w.store