From a925fc6809afc1a52b5fd16ca10ac3fda63e4145 Mon Sep 17 00:00:00 2001 From: Peter Wilcsinszky Date: Fri, 19 Jan 2024 16:24:42 +0100 Subject: [PATCH] fix: add namespace filter when listing aggregator configs (#1644) Signed-off-by: Peter Wilcsinszky --- pkg/resources/model/repository.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/resources/model/repository.go b/pkg/resources/model/repository.go index 0445c0208..7eda28a4e 100644 --- a/pkg/resources/model/repository.go +++ b/pkg/resources/model/repository.go @@ -361,7 +361,7 @@ func (r LoggingResourceRepository) handleMultipleDetachedFluentdObjects(list []v func (r LoggingResourceRepository) FluentdConfigFor(ctx context.Context, logging v1beta1.Logging) (*v1beta1.FluentdConfig, []v1beta1.FluentdConfig, error) { var list v1beta1.FluentdConfigList - if err := r.Client.List(ctx, &list); err != nil { + if err := r.Client.List(ctx, &list, client.InNamespace(logging.Spec.ControlNamespace)); err != nil { return nil, []v1beta1.FluentdConfig{}, err } @@ -401,7 +401,7 @@ func (r LoggingResourceRepository) handleMultipleDetachedSyslogNGObjects(list [] func (r LoggingResourceRepository) SyslogNGConfigFor(ctx context.Context, logging v1beta1.Logging) (*v1beta1.SyslogNGConfig, []v1beta1.SyslogNGConfig, error) { var list v1beta1.SyslogNGConfigList - if err := r.Client.List(ctx, &list); err != nil { + if err := r.Client.List(ctx, &list, client.InNamespace(logging.Spec.ControlNamespace)); err != nil { return nil, []v1beta1.SyslogNGConfig{}, err }