diff --git a/pkg/resources/fluentbit/configsecret.go b/pkg/resources/fluentbit/configsecret.go index d4bbafb27..735affc4f 100644 --- a/pkg/resources/fluentbit/configsecret.go +++ b/pkg/resources/fluentbit/configsecret.go @@ -365,7 +365,7 @@ func (r *Reconciler) configSecret() (runtime.Object, reconciler.DesiredState, er for _, a := range r.loggingRoutes { tenants = append(tenants, a.Status.Tenants...) } - if err := r.configureOutputsForTenants(ctx, tenants, &input, r.fluentdSpec, r.syslogNGSpec); err != nil { + if err := r.configureOutputsForTenants(ctx, tenants, &input); err != nil { return nil, nil, errors.WrapIf(err, "configuring outputs for target tenants") } } else { diff --git a/pkg/resources/fluentbit/tenants.go b/pkg/resources/fluentbit/tenants.go index a06c2027f..b65fa2aff 100644 --- a/pkg/resources/fluentbit/tenants.go +++ b/pkg/resources/fluentbit/tenants.go @@ -88,7 +88,7 @@ func FindTenants(ctx context.Context, target metav1.LabelSelector, reader client return tenants, nil } -func (r *Reconciler) configureOutputsForTenants(ctx context.Context, tenants []v1beta1.Tenant, input *fluentBitConfig, fluentdSpec *v1beta1.FluentdSpec, syslogNGSpec *v1beta1.SyslogNGSpec) error { +func (r *Reconciler) configureOutputsForTenants(ctx context.Context, tenants []v1beta1.Tenant, input *fluentBitConfig) error { var errs error for _, t := range tenants { allNamespaces := len(t.Namespaces) == 0 @@ -100,7 +100,7 @@ func (r *Reconciler) configureOutputsForTenants(ctx context.Context, tenants []v if err := r.resourceReconciler.Client.Get(ctx, types.NamespacedName{Name: t.Name}, logging); err != nil { return errors.WrapIf(err, "getting logging resource") } - if fluentdSpec != nil { + if logging.Spec.FluentdSpec != nil { if input.FluentForwardOutput == nil { input.FluentForwardOutput = &fluentForwardOutputConfig{} } @@ -110,7 +110,7 @@ func (r *Reconciler) configureOutputsForTenants(ctx context.Context, tenants []v Host: aggregatorEndpoint(logging, fluentd.ServiceName), Port: fluentd.ServicePort, }) - } else if syslogNGSpec != nil { + } else if logging.Spec.SyslogNGSpec != nil { if input.SyslogNGOutput == nil { input.SyslogNGOutput = newSyslogNGOutputConfig() }