Skip to content

Commit

Permalink
Watch just the one object
Browse files Browse the repository at this point in the history
Previous code was getting notifications of all objects with matching kind
  • Loading branch information
bboreham committed Apr 15, 2021
1 parent f6b922e commit 0ba4d5d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions controllers/events/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func (m *watchManager) watch(obj runtime.Object, ew eventNotifier) error {
return err
}
listOptions := v1.ListOptions{
FieldSelector: fields.OneTermEqualSelector("metadata.name", ma.GetName()).String(),
ResourceVersion: ma.GetResourceVersion(),
}
wi.watch, err = r.Watch(listOptions)
Expand Down

0 comments on commit 0ba4d5d

Please sign in to comment.