Skip to content

Commit

Permalink
fix tenant aggregation detection
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Wilcsinszky <[email protected]>
  • Loading branch information
pepov committed Feb 5, 2024
1 parent 34c83ba commit ad77b62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/resources/fluentbit/configsecret.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions pkg/resources/fluentbit/tenants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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{}
}
Expand All @@ -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()
}
Expand Down

0 comments on commit ad77b62

Please sign in to comment.