Skip to content

Commit

Permalink
set value in map only if namespace is not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
wildum committed Oct 10, 2023
1 parent 7c61fbd commit 0719d35
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion component/loki/source/kubernetes_events/event_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ func (ctrl *eventController) runError(ctx context.Context) error {
}

defaultNamespaces := map[string]cache.Config{}
defaultNamespaces[ctrl.task.Namespace] = cache.Config{}
if ctrl.task.Namespace != "" {
defaultNamespaces[ctrl.task.Namespace] = cache.Config{}
}
opts := cache.Options{
Scheme: scheme,
DefaultNamespaces: defaultNamespaces,
Expand Down

0 comments on commit 0719d35

Please sign in to comment.