Make notifier optional

This commit is contained in:
Darren Shepherd 2020-07-14 13:28:21 -07:00
parent f4ef308923
commit 34e6de07fb

View File

@ -303,6 +303,7 @@ func (s *Store) listAndWatch(apiOp *types.APIRequest, k8sClient dynamic.Resource
watcher.Stop() watcher.Stop()
}() }()
if s.notifier != nil {
eg.Go(func() error { eg.Go(func() error {
for rel := range s.notifier.OnInboundRelationshipChange(ctx, schema, apiOp.Namespace) { for rel := range s.notifier.OnInboundRelationshipChange(ctx, schema, apiOp.Namespace) {
obj, err := s.byID(apiOp, schema, rel.Name) obj, err := s.byID(apiOp, schema, rel.Name)
@ -312,6 +313,7 @@ func (s *Store) listAndWatch(apiOp *types.APIRequest, k8sClient dynamic.Resource
} }
return fmt.Errorf("closed") return fmt.Errorf("closed")
}) })
}
eg.Go(func() error { eg.Go(func() error {
for event := range watcher.ResultChan() { for event := range watcher.ResultChan() {